5. notes package¶
5.1. Subpackages¶
5.2. Submodules¶
5.3. notes.admin module¶
5.4. notes.apps module¶
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
- 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')¶
- 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
- 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.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
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 aForwardManyToOneDescriptor
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 aForwardManyToOneDescriptor
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 aForwardManyToOneDescriptor
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.
- 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 aReverseManyToOneDescriptor
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 aForwardManyToOneDescriptor
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
- 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 aForwardManyToOneDescriptor
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 aForwardManyToOneDescriptor
instance.
- user_id¶