FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
django-basic-apps/basic/flagging/models.py at master · msGenDev/django-basic-apps · GitHub
msGenDev
django-basic-apps
Repository navigation
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
django-basic-apps
/
basic
/
flagging
/
models.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
39 lines (31 loc) · 1.22 KB
Breadcrumbs
django-basic-apps
/
basic
/
flagging
/
models.py
Copy path
File metadata and controls
39 lines (31 loc) · 1.22 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from
django
.
db
import
models
from
django
.
utils
.
translation
import
ugettext_lazy
as
_
from
django
.
contrib
.
contenttypes
.
models
import
ContentType
from
django
.
contrib
.
contenttypes
.
generic
import
GenericForeignKey
from
django
.
contrib
.
auth
.
models
import
User
class
FlagType
(
models
.
Model
):
""" FlagType model """
title
=
models
.
CharField
(
_
(
'title'
),
blank
=
False
,
max_length
=
255
)
slug
=
models
.
SlugField
()
description
=
models
.
TextField
(
_
(
'description'
),
blank
=
True
)
class
Meta
:
verbose_name
=
_
(
'flag type'
)
verbose_name_plural
=
_
(
'flag types'
)
db_table
=
'flag_types'
def
__unicode__
(
self
):
return
self
.
title
class
Flag
(
models
.
Model
):
""" Flag model """
content_type
=
models
.
ForeignKey
(
ContentType
,
related_name
=
'flags'
)
object_id
=
models
.
IntegerField
()
object
=
GenericForeignKey
()
flag_type
=
models
.
ForeignKey
(
FlagType
)
user
=
models
.
ForeignKey
(
User
)
created
=
models
.
DateTimeField
(
_
(
'created'
),
auto_now_add
=
True
)
modified
=
models
.
DateTimeField
(
_
(
'modified'
),
auto_now
=
True
)
class
Meta
:
verbose_name
=
_
(
'flag'
)
verbose_name_plural
=
_
(
'flags'
)
db_table
=
'flags'
def
__unicode__
(
self
):
return
'<Flagged item>'
Back
|
FazBrowse Home
|
New Git URL