announcements package¶
Subpackages¶
Submodules¶
announcements.admin module¶
Registers admin interfaces for the announcements module.
-
class
announcements.admin.AnnouncementAdmin(model, admin_site)[source]¶ Bases:
django.contrib.admin.options.ModelAdminManage the admin pages for the announcements.
-
content_html(obj)[source]¶ Get the content of the object as html.
- Parameters
obj – the object to render for
- Returns
the stripped html
-
list_display= ('content_html', 'since', 'until', 'visible')¶ show these fields in the admin overview list see :py:method:content_html for the ‘content_html’ field see :py:method:visible for the visible field
-
property
media¶
-
-
class
announcements.admin.FrontpageArticleAdmin(model, admin_site)[source]¶ Bases:
django.contrib.admin.options.ModelAdminManage front page articles.
-
list_display= ('title', 'since', 'until', 'visible')¶ available fields in the admin overview list
-
property
media¶
-
-
class
announcements.admin.SlideAdmin(model, admin_site)[source]¶ Bases:
django.contrib.admin.options.ModelAdminManage the admin pages for the slides.
-
list_display= ('title', 'since', 'until', 'visible')¶ show these fields in the admin overview list see :py:method:visible for the visible field
-
property
media¶
-
announcements.apps module¶
Configuration for the announcement package.
announcements.context_processors module¶
These context processors can be used to expand the context provided to admin views.
announcements.models module¶
The models defined by the announcement package.
-
class
announcements.models.Announcement(*args, **kwargs)[source]¶ Bases:
django.db.models.base.ModelDescribes an announcement.
-
exception
DoesNotExist¶
-
exception
MultipleObjectsReturned¶
-
closeable¶ 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.
-
get_next_by_since(*, field=<django.db.models.fields.DateTimeField: since>, is_next=True, **kwargs)¶
-
get_previous_by_since(*, field=<django.db.models.fields.DateTimeField: since>, is_next=False, **kwargs)¶
-
icon¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
id¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
property
is_visible¶ Is this announcement currently visible.
-
objects= <django.db.models.manager.Manager object>¶
-
since¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
until¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
visible_objects= <announcements.models.VisibleObjectManager object>¶
-
exception
-
class
announcements.models.FrontpageArticle(*args, **kwargs)[source]¶ Bases:
django.db.models.base.ModelFront page articles.
-
exception
DoesNotExist¶
-
exception
MultipleObjectsReturned¶
-
content¶ 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_since(*, field=<django.db.models.fields.DateTimeField: since>, is_next=True, **kwargs)¶
-
get_previous_by_since(*, field=<django.db.models.fields.DateTimeField: since>, 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.
-
property
is_visible¶ Is this announcement currently visible.
-
objects= <django.db.models.manager.Manager object>¶
-
since¶ 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.
-
until¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
visible_objects= <announcements.models.VisibleObjectManager object>¶
-
exception
-
class
announcements.models.Slide(*args, **kwargs)[source]¶ Bases:
django.db.models.base.ModelDescribes an announcement.
-
exception
DoesNotExist¶
-
exception
MultipleObjectsReturned¶
-
content¶ The descriptor for the file attribute on the model instance. Return a FieldFile when accessed so you can write code like:
>>> from myapp.models import MyModel >>> instance = MyModel.objects.get(pk=1) >>> instance.file.size
Assign a file object on assignment so you can do:
>>> with open('/path/to/hello.world') as f: ... instance.file = File(f)
-
event_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.childrenis aReverseManyToOneDescriptorinstance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()defined below.
-
id¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
property
is_visible¶ Is this slide currently visible.
-
members_only¶ 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>¶
-
order¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
since¶ 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.
-
until¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
url¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
url_blank¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
visible_objects= <announcements.models.VisibleObjectManager object>¶
-
exception