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
ae115b53
authored
May 21, 2010
by
Carl Meyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix custom PKs
parent
6781567d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
taggit/managers.py
+1
-1
taggit/tests/tests.py
+6
-1
No files found.
taggit/managers.py
View file @
ae115b53
...
@@ -102,7 +102,7 @@ class TaggableManager(object):
...
@@ -102,7 +102,7 @@ class TaggableManager(object):
def
m2m_reverse_name
(
self
):
def
m2m_reverse_name
(
self
):
if
self
.
use_gfk
:
if
self
.
use_gfk
:
return
"id"
return
"id"
return
self
.
through
.
_meta
.
get_field
(
'content_object'
)
.
rel
.
to
.
_meta
.
pk
.
column
return
self
.
through
.
_meta
.
pk
.
column
def
m2m_column_name
(
self
):
def
m2m_column_name
(
self
):
if
self
.
use_gfk
:
if
self
.
use_gfk
:
...
...
taggit/tests/tests.py
View file @
ae115b53
...
@@ -70,7 +70,8 @@ class TaggableManagerTestCase(BaseTaggingTest):
...
@@ -70,7 +70,8 @@ class TaggableManagerTestCase(BaseTaggingTest):
apple
.
delete
()
apple
.
delete
()
self
.
assert_tags_equal
(
self
.
food_model
.
tags
.
all
(),
[
"green"
])
self
.
assert_tags_equal
(
self
.
food_model
.
tags
.
all
(),
[
"green"
])
def
test_require_pk
(
self
):
f
=
self
.
food_model
()
f
=
self
.
food_model
()
with
self
.
assert_raises
(
ValueError
):
with
self
.
assert_raises
(
ValueError
):
f
.
tags
.
all
()
f
.
tags
.
all
()
...
@@ -178,6 +179,10 @@ class TaggableManagerCustomPKTestCase(TaggableManagerTestCase):
...
@@ -178,6 +179,10 @@ class TaggableManagerCustomPKTestCase(TaggableManagerTestCase):
housepet_model
=
CustomPKHousePet
housepet_model
=
CustomPKHousePet
taggeditem_model
=
TaggedCustomPKPet
taggeditem_model
=
TaggedCustomPKPet
def
test_require_pk
(
self
):
# XXX with a charfield pk, pk is never None, so taggit has no
# way to tell if the instance is saved or not
pass
class
TaggableFormTestCase
(
BaseTaggingTest
):
class
TaggableFormTestCase
(
BaseTaggingTest
):
form_class
=
FoodForm
form_class
=
FoodForm
...
...
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