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
AE UTBM
Sith
Commits
0eb203b1
Commit
0eb203b1
authored
Jul 14, 2016
by
Skia
🤘
Browse files
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
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
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