Jump to >

reviewboard.accounts.models

class ReviewRequestVisit(*args, **kwargs)[source]

Bases: django.db.models.base.Model

A recording of the last time a review request was visited by a user.

Users have one ReviewRequestVisit entry in the database per review request they’ve visited. This is used to keep track of any updates to review requests they’ve already seen, so that we can intelligently inform them that new discussions have taken place.

VISIBLE = u'V'[source]
ARCHIVED = u'A'[source]
MUTED = u'M'[source]
VISIBILITY = ((u'V', u'Visible'), (u'A', u'Archived'), (u'M', u'Muted'))[source]
user[source]
review_request[source]
objects = <reviewboard.accounts.managers.ReviewRequestVisitManager object>[source]
__str__()[source]
__unicode__()[source]

Return a string used for the admin site listing.

get_next_by_timestamp(**morekwargs)[source]
get_previous_by_timestamp(**morekwargs)[source]
get_visibility_display(**morekwargs)[source]
class Profile(*args, **kwargs)[source]

Bases: django.db.models.base.Model

User profile which contains some basic configurable settings.

user[source]
starred_review_requests[source]
starred_groups[source]
objects = <reviewboard.accounts.managers.ProfileManager object>[source]
should_use_rich_text[source]

Get whether rich text should be used by default for this user.

If the user has chosen whether or not to use rich text explicitly, then that choice will be respected. Otherwise, the system default is used.

should_enable_desktop_notifications[source]

Return whether desktop notifications should be used for this user.

If the user has chosen whether or not to use desktop notifications explicitly, then that choice will be respected. Otherwise, we enable desktop notifications by default.

Returns:If the user has set whether they wish to recieve desktop notifications, then use their preference. Otherwise, we return True.
Return type:bool
star_review_request(review_request)[source]

Mark a review request as starred.

This will mark a review request as starred for this user and immediately save to the database.

unstar_review_request(review_request)[source]

Mark a review request as unstarred.

This will mark a review request as starred for this user and immediately save to the database.

star_review_group(review_group)[source]

Mark a review group as starred.

This will mark a review group as starred for this user and immediately save to the database.

unstar_review_group(review_group)[source]

Mark a review group as unstarred.

This will mark a review group as starred for this user and immediately save to the database.

__str__()[source]
avatar_service[source]

The avatar service the user has selected.

Returns:The avatar service.
Return type:djblets.avatars.services.base.AvatarService
get_display_name(viewing_user)[source]

Return the name to display to the given user.

If any of the following is True and the user this profile belongs to has a full name set, the display name will be the the user’s full name:

  • The viewing user is authenticated and this profile is public.
  • The viewing user is the user this profile belongs to.
  • The viewing user is an administrator.
  • The viewing user is a LocalSite administrator on any LocalSite for which the user whose this profile belongs to is a user.

Otherwise the display name will be the user’s username.

Parameters:viewing_user (django.contrib.auth.models.User) – The user who is viewing the profile.
Returns:The name to display.
Return type:unicode
__unicode__()[source]

Return a string used for the admin site listing.

get_extra_data_json()[source]
get_settings_json()[source]
get_timezone_display(**morekwargs)[source]
set_extra_data_json(json)[source]
set_settings_json(json)[source]
site_profiles[source]
class LocalSiteProfile(*args, **kwargs)[source]

Bases: django.db.models.base.Model

User profile information specific to a LocalSite.

user[source]
profile[source]
local_site[source]
direct_incoming_request_count = <djblets.db.fields.counter_field.CounterField: direct_incoming_request_count>[source]
total_incoming_request_count = <djblets.db.fields.counter_field.CounterField: total_incoming_request_count>[source]
pending_outgoing_request_count = <djblets.db.fields.counter_field.CounterField: pending_outgoing_request_count>[source]
total_outgoing_request_count = <djblets.db.fields.counter_field.CounterField: total_outgoing_request_count>[source]
starred_public_request_count = <djblets.db.fields.counter_field.CounterField: starred_public_request_count>[source]
__str__()[source]
__unicode__()[source]

Return a string used for the admin site listing.

decrement_direct_incoming_request_count(*args, **kwargs)[source]
decrement_pending_outgoing_request_count(*args, **kwargs)[source]
decrement_starred_public_request_count(*args, **kwargs)[source]
decrement_total_incoming_request_count(*args, **kwargs)[source]
decrement_total_outgoing_request_count(*args, **kwargs)[source]
get_permissions_json()[source]
increment_direct_incoming_request_count(*args, **kwargs)[source]
increment_pending_outgoing_request_count(*args, **kwargs)[source]
increment_starred_public_request_count(*args, **kwargs)[source]
increment_total_incoming_request_count(*args, **kwargs)[source]
increment_total_outgoing_request_count(*args, **kwargs)[source]
objects = <django.db.models.manager.Manager object>[source]
reinit_direct_incoming_request_count()[source]
reinit_pending_outgoing_request_count()[source]
reinit_starred_public_request_count()[source]
reinit_total_incoming_request_count()[source]
reinit_total_outgoing_request_count()[source]
reload_direct_incoming_request_count()[source]
reload_pending_outgoing_request_count()[source]
reload_starred_public_request_count()[source]
reload_total_incoming_request_count()[source]
reload_total_outgoing_request_count()[source]
set_permissions_json(json)[source]
class Trophy(*args, **kwargs)[source]

Bases: django.db.models.base.Model

A trophy represents an achievement given to the user.

It is associated with a ReviewRequest and a User and can be associated with a LocalSite.

review_request[source]
local_site[source]
user[source]
objects = <reviewboard.accounts.managers.TrophyManager object>[source]
trophy_type[source]

Decorator that converts a method with a single self argument into a property cached on the instance.

get_display_text()[source]

Get the display text for this trophy.

get_next_by_received_date(**morekwargs)[source]
get_previous_by_received_date(**morekwargs)[source]