djblets.webapi.resources.user¶
Built-in resource representing the User model.
- class UserResource¶
Bases:
WebAPIResource
A default resource for representing a Django User model.
- fields = {'email': {'description': "The user's e-mail address", 'type': <class 'djblets.webapi.fields.StringFieldType'>}, 'first_name': {'description': "The user's first name.", 'type': <class 'djblets.webapi.fields.StringFieldType'>}, 'fullname': {'description': "The user's full name (first and last).", 'type': <class 'djblets.webapi.fields.StringFieldType'>}, 'id': {'description': 'The numeric ID of the user.', 'type': <class 'djblets.webapi.fields.IntFieldType'>}, 'last_name': {'description': "The user's last name.", 'type': <class 'djblets.webapi.fields.StringFieldType'>}, 'url': {'description': "The URL to the user's page on the site. This is deprecated and will be removed in a future version.", 'type': <class 'djblets.webapi.fields.StringFieldType'>}, 'username': {'description': "The user's username.", 'type': <class 'djblets.webapi.fields.StringFieldType'>}}¶
- uri_object_key = 'username'¶
- uri_object_key_regex = "[A-Za-z0-9@\\._\\-\\'\\+]+"¶
- model_object_key = 'username'¶
- autogenerate_etags = True¶
- allowed_methods = ('GET',)¶
- serialize_fullname_field(user, **kwargs)¶
- serialize_url_field(user, **kwargs)¶
- has_modify_permissions(request, user, *args, **kwargs)¶
Return whether or not the user can modify this object.
- get_list(**kwargs)¶
Retrieve the list of users on the site.