Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
roomlist
Commits
b25fa7c8
Commit
b25fa7c8
authored
Feb 18, 2015
by
Daniel W Bond
Browse files
modified permissions and slugs
parent
6941d814
Changes
1
Hide whitespace changes
Inline
Side-by-side
roomlist/housing/models.py
View file @
b25fa7c8
...
...
@@ -36,10 +36,10 @@ class Building(TimeStampedModel):
slug
=
AutoSlugField
(
populate_from
=
'name'
,
unique
=
True
)
class
Meta
:
permissions
=
(
(
'view_task'
,
'View task'
),
)
#
class Meta:
#
permissions = (
#
('view_task', 'View task'),
#
)
def
__str__
(
self
):
# __unicode__ on Python 2
return
self
.
name
...
...
@@ -50,10 +50,12 @@ class Floor(TimeStampedModel):
building
=
models
.
ForeignKey
(
'Building'
)
number
=
models
.
IntegerField
()
class
Meta
:
permissions
=
(
(
'view_task'
,
'View task'
),
)
slug
=
AutoSlugField
(
populate_from
=
'number'
)
#class Meta:
# permissions = (
# ('view_task', 'View task'),
# )
def
__str__
(
self
):
# __unicode__ on Python 2
return
self
.
building
.
__str__
()
+
" "
+
self
.
number
.
__str__
()
...
...
@@ -62,7 +64,7 @@ class Room(TimeStampedModel):
number
=
models
.
IntegerField
()
floor
=
models
.
ForeignKey
(
'Floor'
)
slug
=
AutoSlugField
(
populate_from
=
'number'
,
unique
=
True
)
slug
=
AutoSlugField
(
populate_from
=
'number'
)
def
__str__
(
self
):
# __unicode__ on Python 2
return
self
.
building
.
__str__
()
+
" "
+
self
.
number
.
__str__
()
...
...
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