Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
django-taggit
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
d9fb9b16
authored
Mar 23, 2013
by
Christopher Grebs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clarify TagBase and ItemBase as python2 unicode compatible
parent
a7bf54f4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
taggit/models.py
+3
-0
No files found.
taggit/models.py
View file @
d9fb9b16
...
@@ -6,8 +6,10 @@ from django.contrib.contenttypes.generic import GenericForeignKey
...
@@ -6,8 +6,10 @@ from django.contrib.contenttypes.generic import GenericForeignKey
from
django.db
import
models
,
IntegrityError
,
transaction
from
django.db
import
models
,
IntegrityError
,
transaction
from
django.template.defaultfilters
import
slugify
as
default_slugify
from
django.template.defaultfilters
import
slugify
as
default_slugify
from
django.utils.translation
import
ugettext_lazy
as
_
,
ugettext
from
django.utils.translation
import
ugettext_lazy
as
_
,
ugettext
from
django.utils.encoding
import
python_2_unicode_compatible
@python_2_unicode_compatible
class
TagBase
(
models
.
Model
):
class
TagBase
(
models
.
Model
):
name
=
models
.
CharField
(
verbose_name
=
_
(
'Name'
),
unique
=
True
,
max_length
=
100
)
name
=
models
.
CharField
(
verbose_name
=
_
(
'Name'
),
unique
=
True
,
max_length
=
100
)
slug
=
models
.
SlugField
(
verbose_name
=
_
(
'Slug'
),
unique
=
True
,
max_length
=
100
)
slug
=
models
.
SlugField
(
verbose_name
=
_
(
'Slug'
),
unique
=
True
,
max_length
=
100
)
...
@@ -59,6 +61,7 @@ class Tag(TagBase):
...
@@ -59,6 +61,7 @@ class Tag(TagBase):
verbose_name_plural
=
_
(
"Tags"
)
verbose_name_plural
=
_
(
"Tags"
)
@python_2_unicode_compatible
class
ItemBase
(
models
.
Model
):
class
ItemBase
(
models
.
Model
):
def
__str__
(
self
):
def
__str__
(
self
):
return
ugettext
(
"
%(object)
s tagged with
%(tag)
s"
)
%
{
return
ugettext
(
"
%(object)
s tagged with
%(tag)
s"
)
%
{
...
...
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