Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Nounous
re2o
Commits
c0370d3a
Commit
c0370d3a
authored
Jul 18, 2017
by
chirac
Browse files
Fix et empèche des valeurs négatives aux articles
parent
1a6fb718
Changes
2
Hide whitespace changes
Inline
Side-by-side
cotisations/migrations/0017_auto_20170718_2329.py
0 → 100644
View file @
c0370d3a
# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-07-18 21:29
from
__future__
import
unicode_literals
import
django.core.validators
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'cotisations'
,
'0016_auto_20160715_0110'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'article'
,
name
=
'duration'
,
field
=
models
.
IntegerField
(
blank
=
True
,
help_text
=
'Durée exprimée en mois entiers'
,
null
=
True
,
validators
=
[
django
.
core
.
validators
.
MinValueValidator
(
0
)]),
),
migrations
.
AlterField
(
model_name
=
'article'
,
name
=
'name'
,
field
=
models
.
CharField
(
max_length
=
255
,
unique
=
True
),
),
]
cotisations/models.py
View file @
c0370d3a
...
...
@@ -104,10 +104,10 @@ def vente_post_delete(sender, **kwargs):
class
Article
(
models
.
Model
):
PRETTY_NAME
=
"Articles en vente"
name
=
models
.
CharField
(
max_length
=
255
)
name
=
models
.
CharField
(
max_length
=
255
,
unique
=
True
)
prix
=
models
.
DecimalField
(
max_digits
=
5
,
decimal_places
=
2
)
iscotisation
=
models
.
BooleanField
()
duration
=
models
.
IntegerField
(
help_text
=
"Durée exprimée en mois entiers"
,
blank
=
True
,
null
=
True
)
duration
=
models
.
IntegerField
(
validators
=
[
MinValueValidator
(
0
)],
help_text
=
"Durée exprimée en mois entiers"
,
blank
=
True
,
null
=
True
)
def
clean
(
self
):
...
...
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