Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Pole-Web
Website
Commits
ee9225a0
Commit
ee9225a0
authored
Feb 21, 2021
by
HEVELINE Thomas
Committed by
HEVELINE Thomas
Sep 02, 2021
Browse files
(44): reset settings
parent
e6de7612
Changes
2
Hide whitespace changes
Inline
Side-by-side
boutique/models.py
View file @
ee9225a0
...
...
@@ -72,9 +72,9 @@ class Item(models.Model):
@
property
def
customizable
(
self
)
->
bool
:
return
(
(
self
.
customization
is
True
)
or
(
self
.
option
!=
""
)
or
(
self
.
second_option
!=
""
)
(
self
.
customization
is
True
)
or
(
self
.
option
!=
""
)
or
(
self
.
second_option
!=
""
)
)
@
property
...
...
@@ -322,10 +322,10 @@ class OrderItemManager(models.Manager):
def
get_ordered_quantity
(
self
,
item
:
"Item"
,
user
)
->
int
:
"""Get the total quantity ever ordered/in order by that user"""
return
(
self
.
filter
(
item
=
item
,
order__user
=
user
,
order__rejected
=
False
).
aggregate
(
quantity
=
Sum
(
"quantity"
)
)[
"quantity"
]
or
0
self
.
filter
(
item
=
item
,
order__user
=
user
,
order__rejected
=
False
).
aggregate
(
quantity
=
Sum
(
"quantity"
)
)[
"quantity"
]
or
0
)
...
...
site_des_eleves/settings.py
View file @
ee9225a0
...
...
@@ -26,9 +26,9 @@ SECRET_KEY = "&d3ykoj75pkdv_q^4%ens@047+qi^_^379rg#!o%zg1j=pmwi&"
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG
=
True
INTERNAL_IPS
=
[]
INTERNAL_IPS
=
[
"127.0.0.1"
]
ALLOWED_HOSTS
:
List
[
str
]
=
[
'127.0.0.1'
]
ALLOWED_HOSTS
:
List
[
str
]
=
[]
# Application definition
...
...
@@ -101,8 +101,8 @@ DATABASES = {
"default"
:
{
"ENGINE"
:
"django.db.backends.mysql"
,
"NAME"
:
"sde"
,
"USER"
:
"
fenwick
"
,
"PASSWORD"
:
"
fenwick
"
,
"USER"
:
"
root
"
,
"PASSWORD"
:
""
,
"HOST"
:
"127.0.0.1"
,
"PORT"
:
3306
,
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment