Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
rp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
14
Issues
14
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
La Quadrature du Net
rpteam
rp
Commits
1486ce3e
Verified
Commit
1486ce3e
authored
Sep 13, 2017
by
Thibaut Broggi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add groups (Jedi, Padawan, Droid) in database
parent
420236b7
Pipeline
#1236
passed with stages
in 2 minutes
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
apps/rp/migrations/0017_groups.py
apps/rp/migrations/0017_groups.py
+23
-0
No files found.
apps/rp/migrations/0017_groups.py
0 → 100644
View file @
1486ce3e
from
django.db
import
migrations
from
django.contrib.auth.models
import
Group
def
add_groups
(
apps
,
schema_editor
):
groups
=
[
'Jedi'
,
'Padawan'
,
'Droid'
]
for
i
in
groups
:
group
=
Group
(
name
=
i
)
group
.
save
()
def
remove_groups
(
apps
,
schema_editor
):
Group
.
objects
.
all
().
delete
()
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'rp'
,
'0016_auto_20170617_0929'
),
]
operations
=
[
migrations
.
RunPython
(
add_groups
,
reverse_code
=
remove_groups
),
]
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