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.
-
user
[source]¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
child.parent
is aForwardManyToOneDescriptor
instance.
-
review_request
[source]¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
child.parent
is aForwardManyToOneDescriptor
instance.
-
timestamp
[source]¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
visibility
[source]¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
id
[source]¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
-
class
Profile
(*args, **kwargs)[source]¶ Bases:
django.db.models.base.Model
User profile which contains some basic configurable settings.
-
user
[source]¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
child.parent
is aForwardManyToOneDescriptor
instance.
-
first_time_setup_done
[source]¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
should_send_email
[source]¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
should_send_own_updates
[source]¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
collapsed_diffs
[source]¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
wordwrapped_diffs
[source]¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
syntax_highlighting
[source]¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
is_private
[source]¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
open_an_issue
[source]¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
default_use_rich_text
[source]¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
show_closed
[source]¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
sort_review_request_columns
[source]¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
sort_dashboard_columns
[source]¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
sort_submitter_columns
[source]¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
sort_group_columns
[source]¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
review_request_columns
[source]¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
dashboard_columns
[source]¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
submitter_columns
[source]¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
group_columns
[source]¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
starred_review_requests
[source]¶ Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
pizza.toppings
andtopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
starred_groups
[source]¶ Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
pizza.toppings
andtopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
timezone
[source]¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
settings
[source]¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
extra_data
[source]¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
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.
-
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
-
save
(*args, **kwargs)[source]¶ Save the profile to the database.
The profile will only be saved if the user is not affected by read-only mode.
Parameters:
-
id
[source]¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
site_profiles
[source]¶ Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
-
class
LocalSiteProfile
(*args, **kwargs)[source]¶ Bases:
django.db.models.base.Model
User profile information specific to a LocalSite.
-
user
[source]¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
child.parent
is aForwardManyToOneDescriptor
instance.
-
profile
[source]¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
child.parent
is aForwardManyToOneDescriptor
instance.
-
local_site
[source]¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
child.parent
is aForwardManyToOneDescriptor
instance.
-
permissions
[source]¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
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]¶
-
id
[source]¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
local_site_id
[source]¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
-
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.
-
category
[source]¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
received_date
[source]¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
review_request
[source]¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
child.parent
is aForwardManyToOneDescriptor
instance.
-
local_site
[source]¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
child.parent
is aForwardManyToOneDescriptor
instance.
-
user
[source]¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
child.parent
is aForwardManyToOneDescriptor
instance.
-
id
[source]¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
local_site_id
[source]¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-