Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
La Quadrature du Net
Respect My Net
Commits
063123f8
Commit
063123f8
authored
Mar 01, 2016
by
Okhin
Browse files
Adding migrations
parent
ac3ed384
Changes
7
Hide whitespace changes
Inline
Side-by-side
bt/migrations/0001_initial.pyc
0 → 100644
View file @
063123f8
File added
bt/migrations/0002_violation_old.py
0 → 100644
View file @
063123f8
# -*- coding: utf-8 -*-
from
__future__
import
unicode_literals
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'bt'
,
'0001_initial'
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'violation'
,
name
=
'old'
,
field
=
models
.
BooleanField
(
default
=
b
'False'
),
),
]
bt/migrations/0002_violation_old.pyc
0 → 100644
View file @
063123f8
File added
bt/migrations/0003_auto_20160301_2032.py
0 → 100644
View file @
063123f8
# -*- coding: utf-8 -*-
from
__future__
import
unicode_literals
from
django.db
import
migrations
,
models
def
archive_old
(
apps
,
schema_editor
):
Violation
=
apps
.
get_model
(
"bt"
,
"Violation"
)
for
violation
in
Violation
.
objects
.
all
():
person
.
old
=
True
person
.
save
()
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'bt'
,
'0002_violation_old'
),
]
operations
=
[
migrations
.
RunPython
(
archive_old
),
]
bt/migrations/0003_auto_20160301_2032.pyc
0 → 100644
View file @
063123f8
File added
bt/migrations/__init__.pyc
0 → 100644
View file @
063123f8
File added
bt/models.py
View file @
063123f8
...
...
@@ -89,6 +89,7 @@ class Violation(models.Model):
activationid
=
models
.
CharField
(
max_length
=
128
,
blank
=
True
)
state
=
models
.
CharField
(
max_length
=
20
,
choices
=
STATUS
,
default
=
'new'
,
blank
=
True
)
editorial
=
models
.
TextField
(
blank
=
True
)
old
=
models
.
BooleanField
(
default
=
"False"
,
blank
=
False
)
def
confirmations
(
self
):
return
self
.
confirmation_set
.
filter
(
key
=
''
).
count
()
...
...
@@ -108,7 +109,6 @@ class Violation(models.Model):
def
__unicode__
(
self
):
return
"#%s %s/%s"
%
(
self
.
pk
,
self
.
country
,
self
.
operator
)
class
Comment
(
models
.
Model
):
submitter_email
=
models
.
EmailField
()
submitter_name
=
models
.
CharField
(
max_length
=
20
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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