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
58d73e36
authored
Mar 02, 2014
by
Florian Apolloner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed migration support for Django 1.7.
parent
9a736ac8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
taggit/managers.py
+10
-3
No files found.
taggit/managers.py
View file @
58d73e36
...
...
@@ -30,12 +30,12 @@ def _model_name(model):
class
TaggableRel
(
ManyToManyRel
):
def
__init__
(
self
,
field
,
related_name
):
def
__init__
(
self
,
field
,
related_name
,
through
):
self
.
related_name
=
related_name
self
.
limit_choices_to
=
{}
self
.
symmetrical
=
True
self
.
multiple
=
True
self
.
through
=
None
self
.
through
=
through
self
.
field
=
field
def
get_joining_columns
(
self
):
...
...
@@ -76,7 +76,8 @@ class TaggableManager(RelatedField, Field):
through
=
None
,
blank
=
False
,
related_name
=
None
):
Field
.
__init__
(
self
,
verbose_name
=
verbose_name
,
help_text
=
help_text
,
blank
=
blank
,
null
=
True
,
serialize
=
False
)
self
.
through
=
through
or
TaggedItem
self
.
rel
=
TaggableRel
(
self
,
related_name
)
self
.
rel
=
TaggableRel
(
self
,
related_name
,
self
.
through
)
self
.
swappable
=
False
def
__get__
(
self
,
instance
,
model
):
if
instance
is
not
None
and
instance
.
pk
is
None
:
...
...
@@ -90,6 +91,12 @@ class TaggableManager(RelatedField, Field):
)
return
manager
def
deconstruct
(
self
):
name
,
path
,
args
,
kwargs
=
super
(
TaggableManager
,
self
)
.
deconstruct
()
for
kwarg
in
[
'serialize'
,
'null'
]:
del
kwargs
[
kwarg
]
return
name
,
path
,
args
,
kwargs
def
contribute_to_class
(
self
,
cls
,
name
):
if
VERSION
<
(
1
,
7
):
self
.
name
=
self
.
column
=
self
.
attname
=
name
...
...
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