Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
AE
Sith
Commits
0eb203b1
Commit
0eb203b1
authored
Jul 14, 2016
by
Skia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix populate with subscriptions
parent
0248bdf6
Pipeline
#50
passed with stage
in 1 minute and 20 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
8 deletions
+30
-8
core/management/commands/populate.py
core/management/commands/populate.py
+30
-8
No files found.
core/management/commands/populate.py
View file @
0eb203b1
import
os
from
datetime
import
date
from
django.core.management.base
import
BaseCommand
,
CommandError
from
django.core.management
import
call_command
from
django.conf
import
settings
...
...
@@ -111,17 +113,37 @@ Cette page vise à documenter la syntaxe *Markdown* utilisée sur le site.
# Subscription
## Skia
Subscription
(
member
=
Subscriber
.
objects
.
filter
(
pk
=
skia
.
pk
).
first
(),
subscription_type
=
list
(
settings
.
SITH_SUBSCRIPTIONS
.
keys
())[
0
],
payment_method
=
settings
.
SITH_SUBSCRIPTION_PAYMENT_METHOD
[
0
]).
save
()
s
=
Subscription
(
member
=
Subscriber
.
objects
.
filter
(
pk
=
skia
.
pk
).
first
(),
subscription_type
=
list
(
settings
.
SITH_SUBSCRIPTIONS
.
keys
())[
0
],
payment_method
=
settings
.
SITH_SUBSCRIPTION_PAYMENT_METHOD
[
0
])
s
.
subscription_start
=
s
.
compute_start
()
s
.
subscription_end
=
s
.
compute_end
(
duration
=
settings
.
SITH_SUBSCRIPTIONS
[
s
.
subscription_type
][
'duration'
],
start
=
s
.
subscription_start
)
s
.
save
()
## Comptable
Subscription
(
member
=
Subscriber
.
objects
.
filter
(
pk
=
comptable
.
pk
).
first
(),
subscription_type
=
list
(
settings
.
SITH_SUBSCRIPTIONS
.
keys
())[
0
],
payment_method
=
settings
.
SITH_SUBSCRIPTION_PAYMENT_METHOD
[
0
]).
save
()
s
=
Subscription
(
member
=
Subscriber
.
objects
.
filter
(
pk
=
comptable
.
pk
).
first
(),
subscription_type
=
list
(
settings
.
SITH_SUBSCRIPTIONS
.
keys
())[
0
],
payment_method
=
settings
.
SITH_SUBSCRIPTION_PAYMENT_METHOD
[
0
])
s
.
subscription_start
=
s
.
compute_start
()
s
.
subscription_end
=
s
.
compute_end
(
duration
=
settings
.
SITH_SUBSCRIPTIONS
[
s
.
subscription_type
][
'duration'
],
start
=
s
.
subscription_start
)
s
.
save
()
## Richard
Subscription
(
member
=
Subscriber
.
objects
.
filter
(
pk
=
r
.
pk
).
first
(),
subscription_type
=
list
(
settings
.
SITH_SUBSCRIPTIONS
.
keys
())[
0
],
payment_method
=
settings
.
SITH_SUBSCRIPTION_PAYMENT_METHOD
[
0
]).
save
()
s
=
Subscription
(
member
=
Subscriber
.
objects
.
filter
(
pk
=
r
.
pk
).
first
(),
subscription_type
=
list
(
settings
.
SITH_SUBSCRIPTIONS
.
keys
())[
0
],
payment_method
=
settings
.
SITH_SUBSCRIPTION_PAYMENT_METHOD
[
0
])
s
.
subscription_start
=
s
.
compute_start
()
s
.
subscription_end
=
s
.
compute_end
(
duration
=
settings
.
SITH_SUBSCRIPTIONS
[
s
.
subscription_type
][
'duration'
],
start
=
s
.
subscription_start
)
s
.
save
()
## Subscriber
Subscription
(
member
=
Subscriber
.
objects
.
filter
(
pk
=
subscriber
.
pk
).
first
(),
subscription_type
=
list
(
settings
.
SITH_SUBSCRIPTIONS
.
keys
())[
0
],
payment_method
=
settings
.
SITH_SUBSCRIPTION_PAYMENT_METHOD
[
0
]).
save
()
s
=
Subscription
(
member
=
Subscriber
.
objects
.
filter
(
pk
=
subscriber
.
pk
).
first
(),
subscription_type
=
list
(
settings
.
SITH_SUBSCRIPTIONS
.
keys
())[
0
],
payment_method
=
settings
.
SITH_SUBSCRIPTION_PAYMENT_METHOD
[
0
])
s
.
subscription_start
=
s
.
compute_start
()
s
.
subscription_end
=
s
.
compute_end
(
duration
=
settings
.
SITH_SUBSCRIPTIONS
[
s
.
subscription_type
][
'duration'
],
start
=
s
.
subscription_start
)
s
.
save
()
# Clubs
Club
(
name
=
"Bibo'UT"
,
unix_name
=
"bibout"
,
...
...
Write
Preview
Markdown
is supported
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