djangofloor.models
¶
Django models specific to DjangoFloor¶
Currently, only defines models for Notification:
- Notifications themselves,
- NotificationRead, that tracks traces of read actions from users.
Non-authenticated users uses sessions for tracking read actions.
-
class
djangofloor.models.
Notification
(id, content, title, icon, is_active, not_before, not_after, level, auto_hide_seconds, display_mode, broadcast_mode, repeat_count)[source]¶ -
ANY
= 0¶
-
AUTHENTICATED
= 1¶
-
BANNER
= 'banner'¶
-
DANGER
= 'danger'¶
-
exception
DoesNotExist
¶
-
INFO
= 'info'¶
-
MODAL
= 'modal'¶
-
exception
MultipleObjectsReturned
¶
-
NOTIFICATION
= 'notification'¶
-
POPUP
= 'popup'¶
-
SELECTED_GROUPS_OR_USERS
= 2¶
-
SUCCESS
= 'success'¶
-
SYSTEM
= 'system'¶
-
WARNING
= 'warning'¶
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.
-
auto_hide_seconds
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
broadcast_mode
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
content
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
destination_groups
¶ 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.
-
destination_users
¶ 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.
-
display_mode
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
get_broadcast_mode_display
(*moreargs, **morekwargs)¶
-
get_display_mode_display
(*moreargs, **morekwargs)¶
-
get_level_display
(*moreargs, **morekwargs)¶
-
icon
¶ The descriptor for the file attribute on the model instance. Returns a FieldFile when accessed so you can do stuff like:
>>> from myapp.models import MyModel >>> instance = MyModel.objects.get(pk=1) >>> instance.file.size
Assigns a file object on assignment so you can do:
>>> with open('/path/to/hello.world', 'r') as f: ... instance.file = File(f)
-
id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
is_active
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
level
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
not_after
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
not_before
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
notificationread_set
¶ 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.
-
objects
= <django.db.models.manager.Manager object>¶
-
repeat_count
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
title
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
-
class
djangofloor.models.
NotificationRead
(id, notification, user, first_read_time, last_read_time, read_count)[source]¶ -
exception
DoesNotExist
¶
-
exception
MultipleObjectsReturned
¶
-
first_read_time
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
get_next_by_first_read_time
(*moreargs, **morekwargs)¶
-
get_next_by_last_read_time
(*moreargs, **morekwargs)¶
-
get_previous_by_first_read_time
(*moreargs, **morekwargs)¶
-
get_previous_by_last_read_time
(*moreargs, **morekwargs)¶
-
id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
last_read_time
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
notification
¶ 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.
-
notification_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
objects
= <django.db.models.manager.Manager object>¶
-
read_count
¶ 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
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
exception
-
djangofloor.models.
apply_post_migrate_settings
(sender, **kwargs)[source]¶ Defined for calling “post_migrate” method on each ConfigValue setting through the “post_migrate” Django signal
-
djangofloor.models.
apply_pre_migrate_settings
(sender, **kwargs)[source]¶ Defined for calling “pre_migrate” method on each ConfigValue setting through the “pre_migrate” Django signal.
create social apps in database, with data from the config file