message package
admin
- class message.admin.DateOrderForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, instance=None, use_required_attribute=None, renderer=None)
Bases:
django.forms.models.ModelFormValidate whether a validity start date and end date are in the correct order.
- base_fields = {}
- clean()
Hook for doing any extra form-wide cleaning after Field.clean() has been called on every field. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field named ‘__all__’.
- declared_fields = {}
- property media
Return all media required to render the widgets on this form.
- class message.admin.MessageAdmin(model, admin_site)
Bases:
django.contrib.admin.options.ModelAdmin- form
alias of
message.admin.DateOrderForm
- list_display = ['id', 'type', 'title', 'valid_from', 'valid_to']
- property media
apps
models
- class message.models.Message(*args, **kwargs)
Bases:
django.db.models.base.ModelModel for a message that is displayed to the users when the app starts.
- exception DoesNotExist
Bases:
django.core.exceptions.ObjectDoesNotExist
- MTYPE_CHOICES = [('NO', 'Notice'), ('UD', 'Update'), ('CL', 'Changelog'), ('WN', 'Warning'), ('TP', 'Tipp')]
- exception MultipleObjectsReturned
Bases:
django.core.exceptions.MultipleObjectsReturned
- get_next_by_valid_from(*, field=<django.db.models.fields.DateField: valid_from>, is_next=True, **kwargs)
- get_previous_by_valid_from(*, field=<django.db.models.fields.DateField: valid_from>, is_next=False, **kwargs)
- get_type_display(*, field=<django.db.models.fields.CharField: type>)
- 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>
- text
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.
- type
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- valid_from
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- valid_to
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
serializers
- class message.serializers.MessageSerializer(*args, **kwargs)
Bases:
rest_framework.serializers.ModelSerializer- class Meta
Bases:
object- fields = '__all__'
- model
alias of
message.models.Message
urls
views
- class message.views.MessageEndpoint(**kwargs)
Bases:
rest_framework.viewsets.ReadOnlyModelViewSetProvide database table of currently valid messages.
- basename = None
- description = None
- detail = None
- get_queryset()
Get the list of items for this view. This must be an iterable, and may be a queryset. Defaults to using self.queryset.
This method should always be used rather than accessing self.queryset directly, as self.queryset gets evaluated only once, and those results are cached for all subsequent requests.
You may want to override this if you need to provide different querysets depending on the incoming request.
(Eg. return a list of items that is specific to the user)
- name = None
- queryset
- serializer_class
- suffix = None