Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Fukász Rómeó Ervin
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
c362a5bf
authored
Feb 02, 2013
by
Őry Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
school: minimal admin
parent
d823c2ba
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
school/admin.py
+27
-0
No files found.
school/admin.py
0 → 100644
View file @
c362a5bf
from
django.contrib
import
messages
from
django.core.exceptions
import
ValidationError
from
django
import
contrib
from
django.utils.translation
import
ugettext_lazy
as
_
from
school
import
models
import
string
class
GroupInline
(
contrib
.
admin
.
TabularInline
):
model
=
models
.
Group
extra
=
2
class
CourseAdmin
(
contrib
.
admin
.
ModelAdmin
):
model
=
models
.
Course
inlines
=
(
GroupInline
,
)
filter_horizontal
=
(
'owners'
,
)
class
GroupAdmin
(
contrib
.
admin
.
ModelAdmin
):
model
=
models
.
Group
filter_horizontal
=
(
'owners'
,
'members'
,
)
class
SemesterAdmin
(
contrib
.
admin
.
ModelAdmin
):
model
=
models
.
Semester
contrib
.
admin
.
site
.
register
(
models
.
Course
,
CourseAdmin
)
contrib
.
admin
.
site
.
register
(
models
.
Semester
,
SemesterAdmin
)
contrib
.
admin
.
site
.
register
(
models
.
Group
,
GroupAdmin
)
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