berhoel.django.media package¶
Manage media consum.
Subpackages¶
Submodules¶
berhoel.django.media.admin module¶
Django admin for series.
berhoel.django.media.apps module¶
berhoel.django.media.flycheck_apps module¶
berhoel.django.media.forms module¶
Forms for media django project.
- class berhoel.django.media.forms.PersonForm(*args: list, **kwargs: dict)[source]¶
Bases:
ModelForm
- _meta = <django.forms.models.ModelFormOptions object>¶
- base_fields = {'name': <django.forms.fields.CharField object>}¶
- declared_fields = {}¶
- property media¶
Return all media required to render the widgets on this form.
- class berhoel.django.media.forms.SeenForm(*args: list, **kwargs: dict)[source]¶
Bases:
ModelForm
- _meta = <django.forms.models.ModelFormOptions object>¶
- base_fields = {'date': <django.forms.fields.DateField object>, 'watch_item': <django.forms.models.ModelChoiceField object>}¶
- declared_fields = {'date': <django.forms.fields.DateField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- class berhoel.django.media.forms.SeenDeleteForm(*args: list, **kwargs: dict)[source]¶
Bases:
ModelForm
- _meta = <django.forms.models.ModelFormOptions object>¶
- base_fields = {'date': <django.forms.fields.DateField object>, 'watch_item': <django.forms.models.ModelChoiceField object>}¶
- declared_fields = {'date': <django.forms.fields.DateField object>}¶
- property media¶
Return all media required to render the widgets on this form.
berhoel.django.media.models module¶
Django models for series application.
- class berhoel.django.media.models.MediaTypes(value)[source]¶
Bases:
MyDjangoEnum
Media types
- MEDIA = 1¶
- DVD = 2¶
- BROADCAST = 3¶
- RENTAL_VIDEO = 4¶
- THEATRE_VISIT = 5¶
- STREAMING = 6¶
- class berhoel.django.media.models.WatchItemTypes(value)[source]¶
Bases:
MyDjangoEnum
Types for watch items
- WATCH_ITEM = 1¶
- FILM = 2¶
- SERIES_EPISODE = 3¶
- class berhoel.django.media.models.Media(*args, **kwargs)[source]¶
Bases:
PolymorphicModel
Base class for mapping diffenrent media.
- _type = 1¶
- 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.
- family¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- season¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- sub_season¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- exception DoesNotExist¶
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned¶
Bases:
MultipleObjectsReturned
- _meta = <Options for Media>¶
- broadcast¶
Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
- dvd¶
Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
- polymorphic_ctype¶
The model field that stores the
ContentType
reference to the actual class.
- polymorphic_ctype_id¶
- polymorphic_primary_key_name = 'id'¶
- polymorphic_super_sub_accessors_replaced = False¶
- purchases¶
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.
- rentalvideo¶
Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
- streaming¶
Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
- theatrevisit¶
Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
- watch_items¶
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.
- class berhoel.django.media.models.DVD(*args, **kwargs)[source]¶
Bases:
Media
DVD or DVD set.
- _type = 2¶
- disks¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- adver_name¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- exception DoesNotExist¶
Bases:
DoesNotExist
- exception MultipleObjectsReturned¶
Bases:
MultipleObjectsReturned
- _meta = <Options for DVD>¶
- media_ptr¶
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.
- media_ptr_id¶
- polymorphic_primary_key_name = 'id'¶
- polymorphic_super_sub_accessors_replaced = False¶
- sells¶
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.
- class berhoel.django.media.models.Person(*args, **kwargs)[source]¶
Bases:
Model
General person information.
- 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.
- exception DoesNotExist¶
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned¶
Bases:
MultipleObjectsReturned
- _meta = <Options for Person>¶
- broadcasts¶
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>¶
- purchases¶
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.
- rental_videos¶
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.
- sells¶
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.
- streamings¶
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.
- theatre_visits¶
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.
- class berhoel.django.media.models.Purchase(*args, **kwargs)[source]¶
Bases:
Model
Record purchase of media item.
- id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- vendor¶
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.
- price¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- date¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- media¶
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.
- exception DoesNotExist¶
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned¶
Bases:
MultipleObjectsReturned
- _meta = <Options for Purchase>¶
- get_next_by_date(*, field=<django.db.models.fields.DateField: date>, is_next=True, **kwargs)¶
- get_previous_by_date(*, field=<django.db.models.fields.DateField: date>, is_next=False, **kwargs)¶
- objects = <django.db.models.manager.Manager object>¶
- vendor_id¶
- class berhoel.django.media.models.Sell(*args, **kwargs)[source]¶
Bases:
Model
Record selling of media item.
- id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- buyer¶
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.
- price¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- date¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- dvds¶
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.
- exception DoesNotExist¶
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned¶
Bases:
MultipleObjectsReturned
- _meta = <Options for Sell>¶
- buyer_id¶
- get_next_by_date(*, field=<django.db.models.fields.DateField: date>, is_next=True, **kwargs)¶
- get_previous_by_date(*, field=<django.db.models.fields.DateField: date>, is_next=False, **kwargs)¶
- objects = <django.db.models.manager.Manager object>¶
- class berhoel.django.media.models.WatchItem(*args, **kwargs)[source]¶
Bases:
PolymorphicModel
Representing a viewable item.
- _type = 1¶
- id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- medium¶
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.
- dvd_index¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- imdb_url¶
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.
- desc¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- property item_type: WatchItemTypes¶
Return watch item type
- exception DoesNotExist¶
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned¶
Bases:
MultipleObjectsReturned
- _meta = <Options for WatchItem>¶
- film¶
Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
- medium_id¶
- polymorphic_ctype¶
The model field that stores the
ContentType
reference to the actual class.
- polymorphic_ctype_id¶
- polymorphic_primary_key_name = 'id'¶
- polymorphic_super_sub_accessors_replaced = False¶
- seens¶
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.
- seriesepisode¶
Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
- class berhoel.django.media.models.Film(*args, **kwargs)[source]¶
Bases:
WatchItem
Watching a film.
- _type = 2¶
- options¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- exception DoesNotExist¶
Bases:
DoesNotExist
- exception MultipleObjectsReturned¶
Bases:
MultipleObjectsReturned
- _meta = <Options for Film>¶
- polymorphic_primary_key_name = 'id'¶
- polymorphic_super_sub_accessors_replaced = False¶
- watchitem_ptr¶
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.
- watchitem_ptr_id¶
- class berhoel.django.media.models.Series(*args, **kwargs)[source]¶
Bases:
Model
Information of series.
- id¶
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.
- imdb_url¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- order_no¶
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.
- exception DoesNotExist¶
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned¶
Bases:
MultipleObjectsReturned
- _meta = <Options for Series>¶
- objects = <django.db.models.manager.Manager object>¶
- seasons¶
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.
- class berhoel.django.media.models.Season(*args, **kwargs)[source]¶
Bases:
Model
Information on series season as in DVD, broadcast, or streaming.
- series¶
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.
- season¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- subseason¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- exception DoesNotExist¶
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned¶
Bases:
MultipleObjectsReturned
- _meta = <Options for Season>¶
- 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>¶
- series_episodes¶
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.
- series_id¶
- class berhoel.django.media.models.SeriesEpisode(*args, **kwargs)[source]¶
Bases:
WatchItem
Watching an episode of an series.
- _type = 3¶
- season¶
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.
- episode¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- sub_episode¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- exception DoesNotExist¶
Bases:
DoesNotExist
- exception MultipleObjectsReturned¶
Bases:
MultipleObjectsReturned
- _meta = <Options for SeriesEpisode>¶
- polymorphic_primary_key_name = 'id'¶
- polymorphic_super_sub_accessors_replaced = False¶
- season_id¶
- watchitem_ptr¶
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.
- watchitem_ptr_id¶
- class berhoel.django.media.models.Broadcast(*args, **kwargs)[source]¶
Bases:
Media
Broadcast event of media.
- _type = 3¶
- broadcast_service¶
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 DoesNotExist¶
Bases:
DoesNotExist
- exception MultipleObjectsReturned¶
Bases:
MultipleObjectsReturned
- _meta = <Options for Broadcast>¶
- broadcast_service_id¶
- media_ptr¶
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.
- media_ptr_id¶
- polymorphic_primary_key_name = 'id'¶
- polymorphic_super_sub_accessors_replaced = False¶
- class berhoel.django.media.models.RentalVideo(*args, **kwargs)[source]¶
Bases:
Media
Seen media in cinema.
- _type = 4¶
- company¶
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.
- price¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- exception DoesNotExist¶
Bases:
DoesNotExist
- exception MultipleObjectsReturned¶
Bases:
MultipleObjectsReturned
- _meta = <Options for RentalVideo>¶
- company_id¶
- media_ptr¶
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.
- media_ptr_id¶
- polymorphic_primary_key_name = 'id'¶
- polymorphic_super_sub_accessors_replaced = False¶
- class berhoel.django.media.models.TheatreVisit(*args, **kwargs)[source]¶
Bases:
Media
Seen media in cinema.
- _type = 5¶
- theatre¶
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.
- price¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- exception DoesNotExist¶
Bases:
DoesNotExist
- exception MultipleObjectsReturned¶
Bases:
MultipleObjectsReturned
- _meta = <Options for TheatreVisit>¶
- media_ptr¶
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.
- media_ptr_id¶
- polymorphic_primary_key_name = 'id'¶
- polymorphic_super_sub_accessors_replaced = False¶
- theatre_id¶
- class berhoel.django.media.models.SubscriptionPayment(*args, **kwargs)[source]¶
Bases:
Model
Payment for subscription service.
- id¶
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.
- end¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- amount¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- exception DoesNotExist¶
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned¶
Bases:
MultipleObjectsReturned
- _meta = <Options for SubscriptionPayment>¶
- get_next_by_end(*, field=<django.db.models.fields.DateField: end>, is_next=True, **kwargs)¶
- get_next_by_start(*, field=<django.db.models.fields.DateField: start>, is_next=True, **kwargs)¶
- get_previous_by_end(*, field=<django.db.models.fields.DateField: end>, is_next=False, **kwargs)¶
- get_previous_by_start(*, field=<django.db.models.fields.DateField: start>, is_next=False, **kwargs)¶
- objects = <django.db.models.manager.Manager object>¶
- subscriptions¶
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.
- class berhoel.django.media.models.Subscription(*args, **kwargs)[source]¶
Bases:
Model
Streaming subscription.
- id¶
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.
- end¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- payments¶
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.
- exception DoesNotExist¶
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned¶
Bases:
MultipleObjectsReturned
- _meta = <Options for Subscription>¶
- get_next_by_end(*, field=<django.db.models.fields.DateField: end>, is_next=True, **kwargs)¶
- get_next_by_start(*, field=<django.db.models.fields.DateField: start>, is_next=True, **kwargs)¶
- get_previous_by_end(*, field=<django.db.models.fields.DateField: end>, is_next=False, **kwargs)¶
- get_previous_by_start(*, field=<django.db.models.fields.DateField: start>, is_next=False, **kwargs)¶
- objects = <django.db.models.manager.Manager object>¶
- streamings¶
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.
- class berhoel.django.media.models.Streaming(*args, **kwargs)[source]¶
Bases:
Media
Media streamed via streaming service.
- _type = 6¶
- streaming_service¶
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.
- subscription¶
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.
- exception DoesNotExist¶
Bases:
DoesNotExist
- exception MultipleObjectsReturned¶
Bases:
MultipleObjectsReturned
- _meta = <Options for Streaming>¶
- media_ptr¶
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.
- media_ptr_id¶
- polymorphic_primary_key_name = 'id'¶
- polymorphic_super_sub_accessors_replaced = False¶
- streaming_service_id¶
- class berhoel.django.media.models.Seen(*args, **kwargs)[source]¶
Bases:
Model
Represents a viewing event.
- id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- date¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- watch_item¶
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.
- WatchItemTypes_¶
alias of
WatchItemTypes
- exception DoesNotExist¶
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned¶
Bases:
MultipleObjectsReturned
- _meta = <Options for Seen>¶
- get_next_by_date(*, field=<django.db.models.fields.DateField: date>, is_next=True, **kwargs)¶
- get_previous_by_date(*, field=<django.db.models.fields.DateField: date>, is_next=False, **kwargs)¶
- objects = <django.db.models.manager.Manager object>¶
- watch_item_id¶
berhoel.django.media.settings module¶
Django settings for media project.
berhoel.django.media.tests module¶
berhoel.django.media.urls module¶
media URL Configuration The urlpatterns list routes URLs to views. For more information please see
Examples:
Function views
Add an import:
from my_app import views
Add a URL to urlpatterns:
path('', views.home, name='home')
Class-based views
Add an import:
from other_app.views import Home
Add a URL to urlpatterns:
path('', Home.as_view(), name='home')
Including another URLconf
Import the include() function:
from django.urls import include, path
Add a URL to urlpatterns:
path('blog/', include('blog.urls'))
berhoel.django.media.utils module¶
Utilities for media.
- class berhoel.django.media.utils.Calendar(firstweekday: int = 0)[source]¶
Bases:
HTMLCalendar
- cssclasses_weekday_head = ['mon text-bold', 'tue text-bold', 'wed text-bold', 'thu text-bold', 'fri text-bold', 'sat text-bold', 'sun text-bold']¶
- cssclasses = ['mon', 'tue', 'wed', 'thu', 'fri', 'sat table-info', 'sun table-info']¶
- cssclass_month = 'table table-sm table-striped table-bordered'¶
- cssclass_thead = 'table-dark'¶
berhoel.django.media.views module¶
Views from media.
- class berhoel.django.media.views.Section(title: str, container: str = 'container-xl')[source]¶
Bases:
object
- class berhoel.django.media.views.IndexView(**kwargs)[source]¶
Bases:
ListView
- template_name = 'media/index.html'¶
- context_object_name = 'seen_list'¶
- paginate_by = 30¶
- class berhoel.django.media.views.PersonCreateView(**kwargs)[source]¶
Bases:
CreateView
- fields = ('name',)¶
- class berhoel.django.media.views.PersonUpdateView(**kwargs)[source]¶
Bases:
UpdateView
- form_class¶
alias of
PersonForm
- template_name = 'media/person_update_form.html'¶
- class berhoel.django.media.views.Graph(**kwargs)[source]¶
Bases:
TemplateView
- template_name = 'media/graph.html'¶
- property data_frame: DataFrame¶
- property minmax_dates: DatetimeIndex¶
Minimum and maximum of dates in dataset.
- property _v_stack¶
- property data_seen: Scatter¶
- property data_seen_lp: Scatter¶
- property data_avg_full: Scatter¶
- property data_avg_full_lp: Scatter¶
- property data_avg_30: Scatter¶
- property data_avg_30_lp: Scatter¶
berhoel.django.media.widgets module¶
Widgets for media.