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
A prog2-höz tartozó friss repo anyagok itt elérhetőek:
https://git.iit.bme.hu/
Commit
f3bc9db0
authored
Aug 09, 2014
by
Collin Anderson
Committed by
Florian Apolloner
Aug 10, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix AttributeError: 'TaggableRel' object has no attribute 'to'
parent
8c6fc806
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
taggit/managers.py
+3
-2
tests/tests.py
+1
-0
No files found.
taggit/managers.py
View file @
f3bc9db0
...
@@ -33,7 +33,8 @@ def _model_name(model):
...
@@ -33,7 +33,8 @@ def _model_name(model):
class
TaggableRel
(
ManyToManyRel
):
class
TaggableRel
(
ManyToManyRel
):
def
__init__
(
self
,
field
,
related_name
,
through
):
def
__init__
(
self
,
field
,
related_name
,
through
,
to
=
None
):
self
.
to
=
to
self
.
related_name
=
related_name
self
.
related_name
=
related_name
self
.
limit_choices_to
=
{}
self
.
limit_choices_to
=
{}
self
.
symmetrical
=
True
self
.
symmetrical
=
True
...
@@ -224,7 +225,7 @@ class TaggableManager(RelatedField, Field):
...
@@ -224,7 +225,7 @@ class TaggableManager(RelatedField, Field):
manager
=
_TaggableManager
):
manager
=
_TaggableManager
):
Field
.
__init__
(
self
,
verbose_name
=
verbose_name
,
help_text
=
help_text
,
blank
=
blank
,
null
=
True
,
serialize
=
False
)
Field
.
__init__
(
self
,
verbose_name
=
verbose_name
,
help_text
=
help_text
,
blank
=
blank
,
null
=
True
,
serialize
=
False
)
self
.
through
=
through
or
TaggedItem
self
.
through
=
through
or
TaggedItem
self
.
rel
=
TaggableRel
(
self
,
related_name
,
self
.
through
)
self
.
rel
=
TaggableRel
(
self
,
related_name
,
self
.
through
,
to
=
to
)
self
.
swappable
=
False
self
.
swappable
=
False
self
.
manager
=
manager
self
.
manager
=
manager
# NOTE: `to` is ignored, only used via `deconstruct`.
# NOTE: `to` is ignored, only used via `deconstruct`.
...
...
tests/tests.py
View file @
f3bc9db0
...
@@ -326,6 +326,7 @@ class TaggableManagerTestCase(BaseTaggingTestCase):
...
@@ -326,6 +326,7 @@ class TaggableManagerTestCase(BaseTaggingTestCase):
# Check if tag field, which simulates m2m, has django-like api.
# Check if tag field, which simulates m2m, has django-like api.
field
=
self
.
food_model
.
_meta
.
get_field
(
'tags'
)
field
=
self
.
food_model
.
_meta
.
get_field
(
'tags'
)
self
.
assertTrue
(
hasattr
(
field
,
'rel'
))
self
.
assertTrue
(
hasattr
(
field
,
'rel'
))
self
.
assertTrue
(
hasattr
(
field
.
rel
,
'to'
))
self
.
assertTrue
(
hasattr
(
field
,
'related'
))
self
.
assertTrue
(
hasattr
(
field
,
'related'
))
self
.
assertEqual
(
self
.
food_model
,
field
.
related
.
model
)
self
.
assertEqual
(
self
.
food_model
,
field
.
related
.
model
)
...
...
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