Review models¶
-
class
reviews.models.
BaseReviewAbstractModel
(*args, **kwargs)[source]¶ An abstract base class that any custom review models should subclass.
-
comment
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
content_object
¶ Provide a generic many-to-one relation through the
content_type
andobject_id
fields.This class also doubles as an accessor to the related object (similar to ForwardManyToOneDescriptor) by adding itself as a model attribute.
-
content_type
¶ 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.
-
content_type_id
¶
-
object_pk
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
rating
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
weight
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
-
class
reviews.models.
UserReviewAbstractModel
(*args, **kwargs)[source]¶ Abstract class for user review for some object.
-
class
Meta
[source]¶ -
abstract
= False¶
-
ordering
= ('-submit_date',)¶
-
permissions
= [('can_moderate', 'Can moderate reviews')]¶
-
verbose_name
= 'review'¶
-
verbose_name_plural
= 'reviews'¶
-
-
content_object
¶ Provide a generic many-to-one relation through the
content_type
andobject_id
fields.This class also doubles as an accessor to the related object (similar to ForwardManyToOneDescriptor) by adding itself as a model attribute.
-
content_type
¶ 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.
-
get_next_by_submit_date
(*, field=<django.db.models.fields.DateTimeField: submit_date>, is_next=True, **kwargs)¶
-
get_previous_by_submit_date
(*, field=<django.db.models.fields.DateTimeField: submit_date>, is_next=False, **kwargs)¶
-
ip_address
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
is_public
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
objects
¶
-
save
(*args, **kwargs)[source]¶ Save the current instance. Override this in a subclass if you want to control the saving process.
The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.
-
site
¶ 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.
-
site_id
¶
-
submit_date
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
user
¶ 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_id
¶
-
class
-
class
reviews.models.
Review
(*args, **kwargs)[source]¶ A user review for some object.
-
exception
DoesNotExist
¶
-
exception
MultipleObjectsReturned
¶
-
content_object
¶ Provide a generic many-to-one relation through the
content_type
andobject_id
fields.This class also doubles as an accessor to the related object (similar to ForwardManyToOneDescriptor) by adding itself as a model attribute.
-
content_type
¶ 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.
-
get_next_by_submit_date
(*, field=<django.db.models.fields.DateTimeField: submit_date>, is_next=True, **kwargs)¶
-
get_previous_by_submit_date
(*, field=<django.db.models.fields.DateTimeField: submit_date>, is_next=False, **kwargs)¶
-
id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
site
¶ 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
¶ 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.
-
exception