Models
Dependencies
SingletonModel
Model representing a singleton model.
Attributes:
Source code in backend/api/models.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
|
save(*args, **kwargs)
Override save method to validate only one instance exists.
Source code in backend/api/models.py
16 17 18 19 20 21 22 |
|
delete(*args, **kwargs)
Override delete method to block deletes.
Source code in backend/api/models.py
24 25 26 27 28 |
|
Store
Store
Model representing a Store.
Attributes:
Name | Type | Description |
---|---|---|
name |
CharField
|
The name of a store. Required. Unique. |
Source code in backend/api/models.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
|
__str__()
Returns:
Type | Description |
---|---|
String
|
The Store Object name. |
Source code in backend/api/models.py
41 42 43 44 45 46 |
|
Aisle
Aisle
Model representing an aisle in a store.
Attributes:
Name | Type | Description |
---|---|---|
name |
CharField
|
The name of the Aisle. |
order |
IntegerField
|
The order of appearance for Aisle. |
store |
Store
|
An object respresenting a store. |
Source code in backend/api/models.py
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
|
__str__()
Returns:
Type | Description |
---|---|
String
|
The Aisle Object name. |
Source code in backend/api/models.py
63 64 65 66 67 68 |
|
Item
Item
Model representing an item.
Attributes:
Name | Type | Description |
---|---|---|
name |
CharField
|
The name of the Item. Unique. |
matches |
CharField
|
Alternate spelling that matches. |
plural |
CharField
|
Plural spelling of item name. |
aisle |
Aisle
|
An object representing an aisle. |
Source code in backend/api/models.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
|
__str__()
Returns:
Type | Description |
---|---|
String
|
The Item Object name. |
Source code in backend/api/models.py
89 90 91 92 93 94 |
|
ShoppingList
ShoppingList
Model representing a ShopingList object.
Attributes:
Name | Type | Description |
---|---|---|
name |
CharField
|
The name of the shopping list. |
store |
Store
|
An object representing a store. |
Source code in backend/api/models.py
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
|
__str__()
Returns:
Type | Description |
---|---|
String
|
The ShoppingList Object name. |
Source code in backend/api/models.py
109 110 111 112 113 114 |
|
ListItem
ListItem
Model representing a ListItem object.
Attributes:
Name | Type | Description |
---|---|---|
qty |
IntegerField
|
The numder of items for this list item. |
purchased |
BooleanField
|
Wether this list item has been purchased. |
notes |
TextField
|
Notes associated with this list item. |
purch_date(DateFild) |
TextField
|
The date this list item was purchased. |
item |
Item
|
An object representing an Item. |
aisle |
Aisle
|
An object representing an Aisle. |
shopping_list |
ShoppingList
|
An object representing a ShoppingList. |
Source code in backend/api/models.py
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 |
|
__str__()
Returns:
Type | Description |
---|---|
String
|
The ListItem Object name. |
Source code in backend/api/models.py
142 143 144 145 146 147 |
|
Version
Version
Model representing app version.
Fields: - version_number (CharField): The current version of the app.
Source code in backend/api/models.py
150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 |
|
__str__()
Returns:
Type | Description |
---|---|
String
|
The version number. |
Source code in backend/api/models.py
160 161 162 163 164 165 |
|