5. notes package

5.1. Subpackages

5.2. Submodules

5.3. notes.admin module

class notes.admin.NotesAdmin(model, admin_site)[source]

Bases: ModelAdmin

list_display = ['id', 'type', 'title', 'country', 'account', 'created']
list_filter = ('account', 'country', 'type', 'style')
property media

5.4. notes.apps module

class notes.apps.NotesConfig(app_name, app_module)[source]

Bases: AppConfig

default_auto_field = 'django.db.models.BigAutoField'
name = 'notes'

5.5. notes.forms module

class notes.forms.MyDocForm(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)[source]

Bases: ModelForm

class Meta[source]

Bases: object

fields = '__all__'
model

alias of NotesMedia

widgets = {'image': <django.forms.widgets.FileInput object>}
base_fields = {'file': <django.forms.fields.FileField object>, 'name': <django.forms.fields.CharField object>, 'note': <django.forms.models.ModelChoiceField object>, 'user': <django.forms.models.ModelChoiceField object>}
declared_fields = {}
property media

Return all media required to render the widgets on this form.

class notes.forms.NotesForm(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)[source]

Bases: ModelForm

class Meta[source]

Bases: object

fields = '__all__'
model

alias of Notes

base_fields = {'account': <django.forms.models.ModelChoiceField object>, 'addition': <django.forms.models.ModelChoiceField object>, 'appearancescore': <django.forms.fields.TypedChoiceField object>, 'country': <django.forms.models.ModelChoiceField object>, 'floral_description': <django.forms.fields.TypedChoiceField object>, 'fruit_description': <django.forms.fields.TypedChoiceField object>, 'image': <django.forms.fields.ImageField object>, 'key': <django.forms.fields.CharField object>, 'nosescore': <django.forms.fields.TypedChoiceField object>, 'notes': <django.forms.fields.CharField object>, 'overallscore': <django.forms.fields.TypedChoiceField object>, 'roasted_description': <django.forms.fields.TypedChoiceField object>, 'style': <django.forms.models.ModelChoiceField object>, 'tastescore': <django.forms.fields.TypedChoiceField object>, 'title': <django.forms.fields.CharField object>, 'type': <django.forms.fields.TypedChoiceField object>, 'vegetal_description': <django.forms.fields.TypedChoiceField object>, 'year': <django.forms.fields.CharField object>}
declared_fields = {}
property media

Return all media required to render the widgets on this form.

class notes.forms.NotesImgForm(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)[source]

Bases: ModelForm

class Meta[source]

Bases: object

fields = ('title', 'image')
model

alias of Notes

widgets = {'image': <django.forms.widgets.FileInput object>}
base_fields = {'image': <django.forms.fields.ImageField object>, 'title': <django.forms.fields.CharField object>}
declared_fields = {}
property media

Return all media required to render the widgets on this form.

class notes.forms.NotesListUpdate(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)[source]

Bases: NotesForm

class Meta[source]

Bases: Meta

exclude = ['type']
base_fields = {'account': <django.forms.models.ModelChoiceField object>, 'addition': <django.forms.models.ModelChoiceField object>, 'appearancescore': <django.forms.fields.TypedChoiceField object>, 'country': <django.forms.models.ModelChoiceField object>, 'floral_description': <django.forms.fields.TypedChoiceField object>, 'fruit_description': <django.forms.fields.TypedChoiceField object>, 'image': <django.forms.fields.ImageField object>, 'key': <django.forms.fields.CharField object>, 'nosescore': <django.forms.fields.TypedChoiceField object>, 'notes': <django.forms.fields.CharField object>, 'overallscore': <django.forms.fields.TypedChoiceField object>, 'roasted_description': <django.forms.fields.TypedChoiceField object>, 'style': <django.forms.models.ModelChoiceField object>, 'tastescore': <django.forms.fields.TypedChoiceField object>, 'title': <django.forms.fields.CharField object>, 'vegetal_description': <django.forms.fields.TypedChoiceField object>, 'year': <django.forms.fields.CharField object>}
declared_fields = {}
property media

Return all media required to render the widgets on this form.

class notes.forms.NotesMediaFileForm(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)[source]

Bases: ModelForm

class Meta[source]

Bases: object

fields = ('name', 'file')
model

alias of NotesMedia

widgets = {'file': <django.forms.widgets.FileInput object>}
base_fields = {'file': <django.forms.fields.FileField object>, 'name': <django.forms.fields.CharField object>}
declared_fields = {}
property media

Return all media required to render the widgets on this form.

5.6. notes.functions module

notes.functions.add_note_message(wine_id, message, account)[source]
notes.functions.calc_note_score(note_id)[source]
notes.functions.create_note(note_type, owner, wine=None)[source]

Create Note Function Overview

Notes are either associated with a wine in the Cellar ( Additions), or ad-hoc “tastings” . - Raising a Wine order or adding wines using Add Wines both create an associated note with a type of O or A - Orders are received and the associated wine not is updated with the receipt date - Once Wines are received they are put away in the Cellar again the note is updated with put away date -Lastly wines are drunk… each time a wine is drunk the note is updated with a summary of the previous tasting scores and the date it was drunk

using the date the wine was set to drunk

notes.functions.validate_uploaded_file_pdf(file)[source]

5.7. notes.models module

class notes.models.Notes(id, key, addition, type, title, style, country, year, notes, fruit_description, vegetal_description, floral_description, roasted_description, nosescore, appearancescore, tastescore, overallscore, created, last_update, account, image)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

FLORALCHOICES = [('Violet', 'Violet'), ('Rose', 'Rose'), ('Acacia', 'Acacia'), ('Hawthorn', 'Hawthorn'), ('Roasted Hazlenut', 'Roasted Hazlenut'), ('Honey', 'Honey'), ('Linden', 'Linden'), ('-', '-')]
FRUITYCHOICES = [('Lemon', 'Lemon'), ('Grapefruit', 'Grapefruit'), ('Orange', 'Orange'), ('Pineapple', 'Pineapple'), ('Banana', 'Banana'), ('Lychee', 'Lychee'), ('Melon', 'Melon'), ('Muscat', 'Muscat'), ('Apple', 'Apple'), ('Pear', 'Pear'), ('Quince', 'Quince'), ('Strawberry', 'Strawberry'), ('Raspberry', 'Raspberry'), ('Redcurrant', 'Recurrant'), ('Blackcurrant', 'Blackcurrant'), ('Blueberry', 'Blueberry'), ('Blackberry', 'Blackberry'), ('Cherry', 'Cherry'), ('Apricot', 'Apricot'), ('Peach', 'Peach'), ('Almond', 'Almond'), ('Prune', 'Prune'), ('Walnut', 'Walnut'), ('-', '-')]
exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

NOTETYPES = [('Cellar', 'Cellar'), ('General', 'General'), ('Tasting', 'Non cellar Tasting')]
ROASTEDCHOICES = [('Leather', 'Leather'), ('Musk', 'Musk'), ('Butter', 'Butter'), ('Toast', 'Toast'), ('Roasted Almond', 'Roasted Almond'), ('Caramel', 'Caramel'), ('Coffee', 'Coffee'), ('Smoke', 'Smoke'), ('Dark Chocolate', 'Dark Chocolate'), ('-', '-')]
TASTESCORES = [('Pending', 'Pending'), ('Bronze', 'Bronze'), ('Silver', 'Silver'), ('Gold', 'Gold'), ('Platinum', 'Platinum')]
VEGETALCHOICES = [('Green Pepper', 'Green Pepper'), ('Mushroom', 'Mushroom'), ('Truffle', 'Truffle'), ('Wine Lees', 'Wine Lees'), ('Cedar', 'Cedar'), ('Pine', 'Pine'), ('Liquorice', 'Liquorice'), ('Blackcurrant bud', 'Blackcurrant bud'), ('Cut Hay', 'Cut Hay'), ('Thyme', 'Thyme'), ('Vanilla', 'Vanilla'), ('Cinamon', 'Cinamon'), ('Clove', 'Clove'), ('Pepper', 'Pepper'), ('Saffron', 'Saffron'), ('-', '-')]
account

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.

account_id
addition

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.

addition_id
appearancescore

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

property appearancevalue
country

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.

country_id
created

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

delete()[source]
floral_description

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

fruit_description

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

get_appearancescore_display(*, field=<django.db.models.fields.CharField: appearancescore>)
get_floral_description_display(*, field=<django.db.models.fields.CharField: floral_description>)
get_fruit_description_display(*, field=<django.db.models.fields.CharField: fruit_description>)
get_next_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=True, **kwargs)
get_next_by_last_update(*, field=<django.db.models.fields.DateTimeField: last_update>, is_next=True, **kwargs)
get_nosescore_display(*, field=<django.db.models.fields.CharField: nosescore>)
get_overallscore_display(*, field=<django.db.models.fields.CharField: overallscore>)
get_previous_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=False, **kwargs)
get_previous_by_last_update(*, field=<django.db.models.fields.DateTimeField: last_update>, is_next=False, **kwargs)
get_roasted_description_display(*, field=<django.db.models.fields.CharField: roasted_description>)
get_tastescore_display(*, field=<django.db.models.fields.CharField: tastescore>)
get_type_display(*, field=<django.db.models.fields.CharField: type>)
get_vegetal_description_display(*, field=<django.db.models.fields.CharField: vegetal_description>)
id

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

image

Just like the FileDescriptor, but for ImageFields. The only difference is assigning the width/height to the width_field/height_field, if appropriate.

key

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

last_update

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

nosescore

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

property nosevalue
note_key

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.

notes

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>
overallscore

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

property overallvalue
roasted_description

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

style

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.

style_id
tastescore

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

property tastevalue
title

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

property totalvalue
type

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

vegetal_description

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

year

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

class notes.models.NotesMedia(id, note, file, name, user)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

delete()[source]
file

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)
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.

note

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.

note_id
objects = <django.db.models.manager.Manager object>
user

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.

user_id
notes.models.upload_path(instance, filename)[source]
notes.models.value_convert(score)[source]

5.8. notes.urls module

5.9. notes.views module

notes.views.attach_doc(request, id)[source]
notes.views.delete_image(request, pk)[source]
notes.views.list_wines(request)[source]
notes.views.note_delete(request, id)[source]
notes.views.note_form(request)[source]
notes.views.note_list(request)[source]
notes.views.note_update(request, pk)[source]
notes.views.upload_img_form(request, id)[source]

5.10. Module contents