pizzas package¶
Subpackages¶
Submodules¶
pizzas.admin module¶
Registers admin interfaces for the pizzas module
-
class
pizzas.admin.
OrderAdmin
(model, admin_site)[source]¶ Bases:
utils.admin.DoNextModelAdmin
Manage the orders
-
exclude
= ('payment',)¶
-
has_change_permission
(request, order=None)[source]¶ Only give change permission if the user is an organiser
-
has_delete_permission
(request, order=None)[source]¶ Only give delete permission if the user is an organiser
-
has_view_permission
(request, order=None)[source]¶ Only give view permission if the user is an organiser
-
list_display
= ('pizza_event', 'member_first_name', 'member_last_name', 'product', 'payment')¶
-
property
media
¶
-
-
class
pizzas.admin.
PizzaEventAdmin
(model, admin_site)[source]¶ Bases:
django.contrib.admin.options.ModelAdmin
Manage the pizza events
-
autocomplete_fields
= ('event',)¶
-
date_hierarchy
= 'start'¶
-
exclude
= ('end_reminder',)¶
-
has_change_permission
(request, obj=None)[source]¶ Only allow access to the change form if the user is an organiser
-
has_delete_permission
(request, obj=None)[source]¶ Only allow access to delete if the user is an organiser
-
list_display
= ('title', 'start', 'end', 'notification_enabled', 'orders')¶
-
property
media
¶
-
search_fields
= ['event__title_en', 'event__title_nl']¶
-
pizzas.admin_views module¶
Admin views provided by the pizzas package
pizzas.apps module¶
Configuration for the pizzas package
pizzas.decorators module¶
The decorators defined by the pizzas package
pizzas.models module¶
The models defined by the pizzas package
-
class
pizzas.models.
AvailableProductManager
(*args, **kwargs)[source]¶ Bases:
django.db.models.manager.Manager
Only shows available products
-
class
pizzas.models.
Order
(*args, **kwargs)[source]¶ Bases:
django.db.models.base.Model
,payments.models.Payable
Describes an order of an item during an event
-
exception
DoesNotExist
¶
-
exception
MultipleObjectsReturned
¶
-
property
can_be_changed
¶
-
clean
()[source]¶ Hook for doing any extra model-wide validation after clean() has been called on every field by self.clean_fields. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field defined by NON_FIELD_ERRORS.
-
id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
member
¶ 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.
-
property
member_first_name
¶
-
member_id
¶
-
property
member_last_name
¶
-
property
member_name
¶
-
name
¶ 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>¶
-
payment
¶ Accessor to the related object on the forward side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Restaurant.place
is aForwardOneToOneDescriptor
instance.
-
property
payment_amount
¶
-
payment_id
¶
-
property
payment_notes
¶
-
property
payment_payer
¶
-
property
payment_topic
¶
-
pizza_event
¶ 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.
-
pizza_event_id
¶
-
product
¶ 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.
-
product_id
¶
-
exception
-
class
pizzas.models.
PizzaEvent
(*args, **kwargs)[source]¶ Bases:
django.db.models.base.Model
Describes an event where pizzas can be ordered
-
exception
DoesNotExist
¶
-
exception
MultipleObjectsReturned
¶
-
clean
()[source]¶ Hook for doing any extra model-wide validation after clean() has been called on every field by self.clean_fields. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field defined by NON_FIELD_ERRORS.
-
classmethod
current
()[source]¶ Get the currently relevant pizza event: the first one that starts within 8 hours from now.
-
end
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
end_reminder
¶ Accessor to the related object on the forward side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Restaurant.place
is aForwardOneToOneDescriptor
instance.
-
end_reminder_id
¶
-
event
¶ Accessor to the related object on the forward side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Restaurant.place
is aForwardOneToOneDescriptor
instance.
-
event_id
¶
-
get_next_by_end
(*, field=<django.db.models.fields.DateTimeField: end>, is_next=True, **kwargs)¶
-
get_next_by_start
(*, field=<django.db.models.fields.DateTimeField: start>, is_next=True, **kwargs)¶
-
get_previous_by_end
(*, field=<django.db.models.fields.DateTimeField: end>, is_next=False, **kwargs)¶
-
get_previous_by_start
(*, field=<django.db.models.fields.DateTimeField: start>, is_next=False, **kwargs)¶
-
property
has_ended
¶
-
id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
property
in_the_future
¶
-
property
just_ended
¶
-
objects
= <django.db.models.manager.Manager object>¶
-
order_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.
-
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.
-
send_notification
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
start
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
property
title
¶
-
exception
-
class
pizzas.models.
Product
(*args, **kwargs)[source]¶ Bases:
django.db.models.base.Model
Describes a product
-
exception
DoesNotExist
¶
-
exception
MultipleObjectsReturned
¶
-
available
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
available_products
= <pizzas.models.AvailableProductManager object>¶
-
property
description
¶ Accessor that fetches the localized variant of description
-
description_en
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
description_nl
¶ 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.
-
name
¶ 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_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.
-
price
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
restricted
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
exception
pizzas.services module¶
-
pizzas.services.
can_change_order
(member, pizza_event)[source]¶ Determine if a certain member can edit orders of an event :param member: Member who wants to change and order :param pizza_event: The event for which we want to change an order :return: True if we can change an order else False
pizzas.signals module¶
The signals checked by the pizzas package
-
pizzas.signals.
post_registration_save
(sender, instance, **kwargs)[source]¶ Update members on pizza reminder notification
pizzas.urls module¶
The routes defined by this package
pizzas.views module¶
Views provided by the pizzas package