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
b9dadfa1
authored
Mar 28, 2013
by
Florian Apolloner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed support for Django 1.2
parent
bd04ce59
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
23 deletions
+13
-23
taggit/models.py
+13
-23
No files found.
taggit/models.py
View file @
b9dadfa1
...
@@ -24,17 +24,14 @@ class TagBase(models.Model):
...
@@ -24,17 +24,14 @@ class TagBase(models.Model):
def
save
(
self
,
*
args
,
**
kwargs
):
def
save
(
self
,
*
args
,
**
kwargs
):
if
not
self
.
pk
and
not
self
.
slug
:
if
not
self
.
pk
and
not
self
.
slug
:
self
.
slug
=
self
.
slugify
(
self
.
name
)
self
.
slug
=
self
.
slugify
(
self
.
name
)
if
django
.
VERSION
>=
(
1
,
2
):
from
django.db
import
router
from
django.db
import
router
using
=
kwargs
.
get
(
"using"
)
or
router
.
db_for_write
(
using
=
kwargs
.
get
(
"using"
)
or
router
.
db_for_write
(
type
(
self
),
instance
=
self
)
type
(
self
),
instance
=
self
)
# Make sure we write to the same db for all attempted writes,
# Make sure we write to the same db for all attempted writes,
# with a multi-master setup, theoretically we could try to
# with a multi-master setup, theoretically we could try to
# write and rollback on different DBs
# write and rollback on different DBs
kwargs
[
"using"
]
=
using
kwargs
[
"using"
]
=
using
trans_kwargs
=
{
"using"
:
using
}
trans_kwargs
=
{
"using"
:
using
}
else
:
trans_kwargs
=
{}
i
=
0
i
=
0
while
True
:
while
True
:
i
+=
1
i
+=
1
...
@@ -113,18 +110,11 @@ class TaggedItemBase(ItemBase):
...
@@ -113,18 +110,11 @@ class TaggedItemBase(ItemBase):
class
GenericTaggedItemBase
(
ItemBase
):
class
GenericTaggedItemBase
(
ItemBase
):
object_id
=
models
.
IntegerField
(
verbose_name
=
_
(
'Object id'
),
db_index
=
True
)
object_id
=
models
.
IntegerField
(
verbose_name
=
_
(
'Object id'
),
db_index
=
True
)
if
django
.
VERSION
<
(
1
,
2
):
content_type
=
models
.
ForeignKey
(
content_type
=
models
.
ForeignKey
(
ContentType
,
ContentType
,
verbose_name
=
_
(
'Content type'
),
verbose_name
=
_
(
'Content type'
),
related_name
=
"
%(app_label)
s_
%(class)
s_tagged_items"
related_name
=
"
%(class)
s_tagged_items"
)
)
else
:
content_type
=
models
.
ForeignKey
(
ContentType
,
verbose_name
=
_
(
'Content type'
),
related_name
=
"
%(app_label)
s_
%(class)
s_tagged_items"
)
content_object
=
GenericForeignKey
()
content_object
=
GenericForeignKey
()
class
Meta
:
class
Meta
:
...
...
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