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
BDE
nk20
Commits
9d56b6ec
Unverified
Commit
9d56b6ec
authored
Jul 16, 2019
by
erdnaxe
🦋
Browse files
Fix note migration
parent
b1d96fae
Changes
2
Hide whitespace changes
Inline
Side-by-side
note/migrations/0001_initial.py
View file @
9d56b6ec
# Generated by Django 2.2.3 on 2019-07-
08 14:08
# Generated by Django 2.2.3 on 2019-07-
16 07:17
from
django.conf
import
settings
from
django.db
import
migrations
,
models
...
...
@@ -19,8 +19,8 @@ class Migration(migrations.Migration):
name
=
'NoteClub'
,
fields
=
[
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'
sold
e'
,
models
.
IntegerField
(
help_text
=
"en centime, l' argent
cr
é
dit
é pour cette instance"
,
verbose_name
=
'
solde du compt
e'
)),
(
'active'
,
models
.
BooleanField
(
default
=
True
,
verbose_name
=
'
etat du compt
e'
)),
(
'
balanc
e'
,
models
.
DecimalField
(
decimal_places
=
2
,
default
=
0
,
help_text
=
'money
cr
e
dit
ed for this instance'
,
max_digits
=
8
,
verbose_name
=
'
account balanc
e'
)),
(
'
is_
active'
,
models
.
BooleanField
(
default
=
True
,
verbose_name
=
'
is activ
e'
)),
],
options
=
{
'abstract'
:
False
,
...
...
@@ -30,9 +30,9 @@ class Migration(migrations.Migration):
name
=
'NoteSpec'
,
fields
=
[
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'
sold
e'
,
models
.
IntegerField
(
help_text
=
"en centime, l' argent
cr
é
dit
é pour cette instance"
,
verbose_name
=
'
solde du compt
e'
)),
(
'active'
,
models
.
BooleanField
(
default
=
True
,
verbose_name
=
'
etat du compt
e'
)),
(
'account_type'
,
models
.
CharField
(
choices
=
[(
'CH'
,
'
chèques
'
),
(
'CB'
,
'
Carte Bancaire'
),
(
'VB'
,
'Virement Bancaire
'
),
(
'CA'
,
'
C
ash'
),
(
'RB'
,
'
Remboursement
'
)],
max_length
=
2
,
unique
=
True
)),
(
'
balanc
e'
,
models
.
DecimalField
(
decimal_places
=
2
,
default
=
0
,
help_text
=
'money
cr
e
dit
ed for this instance'
,
max_digits
=
8
,
verbose_name
=
'
account balanc
e'
)),
(
'
is_
active'
,
models
.
BooleanField
(
default
=
True
,
verbose_name
=
'
is activ
e'
)),
(
'account_type'
,
models
.
CharField
(
choices
=
[(
'CH'
,
'
bank check
'
),
(
'CB'
,
'
credit card'
),
(
'VB'
,
'bank transfer
'
),
(
'CA'
,
'
c
ash'
),
(
'RB'
,
'
refund
'
)],
max_length
=
2
,
unique
=
True
)),
],
options
=
{
'abstract'
:
False
,
...
...
@@ -42,13 +42,13 @@ class Migration(migrations.Migration):
name
=
'NoteUser'
,
fields
=
[
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'
sold
e'
,
models
.
IntegerField
(
help_text
=
"en centime, l' argent
cr
é
dit
é pour cette instance"
,
verbose_name
=
'
solde du compt
e'
)),
(
'active'
,
models
.
BooleanField
(
default
=
True
,
verbose_name
=
'
etat du compt
e'
)),
(
'
balanc
e'
,
models
.
DecimalField
(
decimal_places
=
2
,
default
=
0
,
help_text
=
'money
cr
e
dit
ed for this instance'
,
max_digits
=
8
,
verbose_name
=
'
account balanc
e'
)),
(
'
is_
active'
,
models
.
BooleanField
(
default
=
True
,
verbose_name
=
'
is activ
e'
)),
(
'user'
,
models
.
OneToOneField
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
settings
.
AUTH_USER_MODEL
)),
],
options
=
{
'verbose_name'
:
"
O
ne's
N
ote"
,
'verbose_name_plural'
:
'
U
sers
N
ote'
,
'verbose_name'
:
"
o
ne's
n
ote"
,
'verbose_name_plural'
:
'
u
sers
n
ote'
,
},
),
migrations
.
CreateModel
(
...
...
note/models.py
View file @
9d56b6ec
...
...
@@ -41,6 +41,8 @@ class Note(models.Model):
verbose_name
=
_
(
'account balance'
),
help_text
=
_
(
"money credited for this instance"
),
decimal_places
=
2
,
# Limit to centimes
max_digits
=
8
,
# Limit to 999999,99€
default
=
0
,
)
is_active
=
models
.
BooleanField
(
default
=
True
,
...
...
@@ -64,27 +66,19 @@ class NoteUser(Note):
verbose_name
=
_
(
"one's note"
)
verbose_name_plural
=
_
(
"users note"
)
def
__str__
(
self
):
return
self
.
user
.
get_username
()
class
NoteSpec
(
Note
):
"""
A Note for special Account, where real money enter or leave the system.
- Cash
- Credit Card
- Bank Transfert
- Bank Check
- Refund
A Note for special account, where real money enter or leave the system
"""
account_type
=
models
.
CharField
(
max_length
=
2
,
choices
=
(
(
"CH"
,
"chèques"
),
(
"CB"
,
"Carte Bancaire"
),
(
"VB"
,
"Virement Bancaire"
),
(
"CA"
,
"C
ash"
),
(
"RB"
,
"Remboursement"
)
(
"CH"
,
_
(
"bank check"
)
),
(
"CB"
,
_
(
"credit card"
)
),
(
"VB"
,
_
(
"bank transfer"
)
),
(
"CA"
,
_
(
"c
ash"
)
)
,
(
"RB"
,
_
(
"refund"
)),
),
unique
=
True
,
)
...
...
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