berhoel.django.media package

Manage media consum.

Subpackages

Submodules

berhoel.django.media.admin module

Django admin for series.

class berhoel.django.media.admin.PurchaseModelAdmin(model, admin_site)[source]

Bases: ModelAdmin

__str__()[source]

Return str(self).

property media

berhoel.django.media.apps module

class berhoel.django.media.apps.Djangomediaarchive(app_name, app_module)[source]

Bases: AppConfig

default_auto_field = 'django.db.models.AutoField'
name = 'berhoel.django.media'

berhoel.django.media.flycheck_apps module

class berhoel.django.media.flycheck_apps.Djangomediaarchive(app_name, app_module)[source]

Bases: AppConfig

default_auto_field = 'django.db.models.AutoField'
name = 'berhoel.django.media'

berhoel.django.media.forms module

Forms for media django project.

class berhoel.django.media.forms.PersonForm(*args: list, **kwargs: dict)[source]

Bases: ModelForm

class Meta[source]

Bases: object

model

alias of Person

exclude = ()
__init__(*args: list, **kwargs: dict)[source]
_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

class Meta[source]

Bases: object

model

alias of Seen

fields = ('date', 'watch_item')
__init__(*args: list, **kwargs: dict)[source]
_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

class Meta[source]

Bases: object

model

alias of Seen

fields = ('date', 'watch_item')
__init__(*args: list, **kwargs: dict)[source]
_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.MyDjangoEnum(value)[source]

Bases: Enum

Prepare Enums for Django

property do_not_call_in_templates: bool

Prevent instances from being called in templates.

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
__str__() str[source]

Return str(self).

class berhoel.django.media.models.WatchItemTypes(value)[source]

Bases: MyDjangoEnum

Types for watch items

WATCH_ITEM = 1
FILM = 2
SERIES_EPISODE = 3
__str__()[source]

Return str(self).

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.

__str__() str[source]

Return str(self).

property item_type: Enum

Return media type

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 a ReverseOneToOneDescriptor 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 a ReverseOneToOneDescriptor 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 and Topping.pizzas are ManyToManyDescriptor 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 a ReverseOneToOneDescriptor 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 a ReverseOneToOneDescriptor 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 a ReverseOneToOneDescriptor 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 a ReverseManyToOneDescriptor 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.

__str__() str[source]

Return str(self).

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 a ForwardOneToOneDescriptor 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 and Topping.pizzas are ManyToManyDescriptor 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.

__str__() str[source]

Return str(self).

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 a ReverseManyToOneDescriptor 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 a ReverseManyToOneDescriptor 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 a ReverseManyToOneDescriptor 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 a ReverseManyToOneDescriptor 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 a ReverseManyToOneDescriptor 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 a ReverseManyToOneDescriptor 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 a ForwardManyToOneDescriptor 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 and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

__str__() str[source]

Return str(self).

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 a ForwardManyToOneDescriptor 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 and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

__str__() str[source]

Return str(self).

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 a ForwardManyToOneDescriptor 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.

__str__()[source]

Return str(self).

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 a ReverseOneToOneDescriptor 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 a ReverseManyToOneDescriptor 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 a ReverseOneToOneDescriptor 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.

__str__() str[source]

Return str(self).

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 a ForwardOneToOneDescriptor 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.

__str__() str[source]

Return str(self).

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 a ReverseManyToOneDescriptor 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 a ForwardManyToOneDescriptor 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.

__str__() str[source]

Return str(self).

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 a ReverseManyToOneDescriptor 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 a ForwardManyToOneDescriptor 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.

__str__() str[source]

Return str(self).

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 a ForwardOneToOneDescriptor 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 a ForwardManyToOneDescriptor instance.

__str__() str[source]

Return str(self).

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 a ForwardOneToOneDescriptor 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 a ForwardManyToOneDescriptor instance.

price

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

__str__() str[source]

Return str(self).

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 a ForwardOneToOneDescriptor 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 a ForwardManyToOneDescriptor instance.

price

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

__str__() str[source]

Return str(self).

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 a ForwardOneToOneDescriptor 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 and Topping.pizzas are ManyToManyDescriptor 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 and Topping.pizzas are ManyToManyDescriptor 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 and Topping.pizzas are ManyToManyDescriptor 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 a ForwardManyToOneDescriptor 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 and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

__str__() str[source]

Return str(self).

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 a ForwardOneToOneDescriptor 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 a ForwardManyToOneDescriptor instance.

WatchItemTypes_

alias of WatchItemTypes

__str__() str[source]

Return str(self).

property media_type: str

return mediat type as string

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

class berhoel.django.media.tests.MyTest(methodName='runTest')[source]

Bases: TestCase

_classSetupFailed = False
_class_cleanups = []

berhoel.django.media.urls module

media URL Configuration The urlpatterns list routes URLs to views. For more information please see

Examples:

Function views

  1. Add an import:

    from my_app import views
    
  2. Add a URL to urlpatterns:

    path('', views.home, name='home')
    

Class-based views

  1. Add an import:

    from other_app.views import Home
    
  2. Add a URL to urlpatterns:

    path('', Home.as_view(), name='home')
    

Including another URLconf

  1. Import the include() function:

    from django.urls import include, path
    
  2. 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'
__init__(firstweekday: int = 0)[source]
formatday(day: int, weekday: int) str[source]

Format calendar day entry.

formatweekday(day: int) str[source]

Return a weekday name as a table header.

formatmonth(theyear: Optional[int] = None, themonth: Optional[int] = None, withyear: bool = True) str[source]

Return a formatted month as a table.

berhoel.django.media.views module

Views from media.

class berhoel.django.media.views.Section(title: str, container: str = 'container-xl')[source]

Bases: object

title: str
container: str = 'container-xl'
__init__(title: str, container: str = 'container-xl') None
class berhoel.django.media.views.IndexView(**kwargs)[source]

Bases: ListView

template_name = 'media/index.html'
context_object_name = 'seen_list'
paginate_by = 30
static get_queryset() list[source]

Get all seen items.

get_context_data(*, object_list=None, **kwargs: dict) dict[source]

Get the context for this view.

berhoel.django.media.views.calendar_view(request, **kwargs)[source]
class berhoel.django.media.views.PersonCreateView(**kwargs)[source]

Bases: CreateView

model

alias of Person

fields = ('name',)
get_context_data(**kwargs: dict) dict[source]

Insert the form into the context dict.

class berhoel.django.media.views.PersonUpdateView(**kwargs)[source]

Bases: UpdateView

model

alias of Person

form_class

alias of PersonForm

template_name = 'media/person_update_form.html'
get_success_url()[source]

Return the URL to redirect to after processing a valid form.

get_context_data(**kwargs: dict) dict[source]

Insert the form into the context dict.

class berhoel.django.media.views.SeenUpdateView(**kwargs)[source]

Bases: UpdateView

model

alias of Seen

form_class

alias of SeenForm

get_success_url()[source]

Return the URL to redirect to after processing a valid form.

get_context_data(**kwargs: dict) dict[source]

Insert the form into the context dict.

class berhoel.django.media.views.SeenDeleteView(*args, **kwargs)[source]

Bases: DeleteView

model

alias of Seen

get_success_url()[source]

Return the URL to redirect to after processing a valid form.

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
get_context_data(**kwargs) dict[source]

berhoel.django.media.widgets module

Widgets for media.

class berhoel.django.media.widgets.BootstrapDatePickerInput(attrs=None, format=None)[source]

Bases: DateInput

template_name = 'widgets/bootstrap_datepicker.html'
get_context(name: str, value: str, attrs: dict) dict[source]
property media
class berhoel.django.media.widgets.BootstrapDateTimePickerInput(attrs=None, format=None)[source]

Bases: DateTimeInput

template_name = 'widgets/bootstrap_datetimepicker.html'
get_context(name: str, value: str, attrs: dict) dict[source]
property media