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
d401839e
authored
Dec 08, 2009
by
Alex Gaynor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
my spelling is epically bad.
parent
5c35d4f9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
5 deletions
+4
-5
taggit/forms.py
+1
-2
taggit/tests/tests.py
+3
-3
No files found.
taggit/forms.py
View file @
d401839e
...
...
@@ -7,12 +7,11 @@ class TaggableForm(forms.ModelForm):
tags
=
forms
.
CharField
(
help_text
=
"A comma seperated list of tags."
)
def
save
(
self
,
commit
=
True
):
obj
=
super
(
TaggableForm
,
self
)
.
save
(
commit
=
False
)
obj
=
super
(
TaggableForm
,
self
)
.
save
(
commit
=
commit
)
def
save_tags
():
# TODO: Remove the assumption that the manager is named 'tags'
obj
.
tags
.
set
(
*
parse_tags
(
self
.
cleaned_data
[
'tags'
]))
if
commit
:
obj
.
save
()
save_tags
()
else
:
obj
.
save_tags
=
save_tags
...
...
taggit/tests/tests.py
View file @
d401839e
...
...
@@ -19,9 +19,9 @@ class AddTagTestCase(BaseTaggingTest):
self
.
assert_tags_equal
(
apple
.
tags
.
all
(),
[
'green'
])
self
.
assert_tags_equal
(
Food
.
tags
.
all
(),
[
'green'
])
p
air
=
Food
.
objects
.
create
(
name
=
"pai
r"
)
p
ai
r
.
tags
.
add
(
'green'
)
self
.
assert_tags_equal
(
p
ai
r
.
tags
.
all
(),
[
'green'
])
p
ear
=
Food
.
objects
.
create
(
name
=
"pea
r"
)
p
ea
r
.
tags
.
add
(
'green'
)
self
.
assert_tags_equal
(
p
ea
r
.
tags
.
all
(),
[
'green'
])
self
.
assert_tags_equal
(
Food
.
tags
.
all
(),
[
'green'
])
apple
.
tags
.
add
(
'red'
)
...
...
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