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
73c6fad4
authored
Sep 27, 2010
by
Gert Van Gool
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support for help_text and use the provided verbose_name and help_text in the formfield
parent
e58d81e0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
taggit/managers.py
+4
-3
No files found.
taggit/managers.py
View file @
73c6fad4
...
...
@@ -36,11 +36,12 @@ class TaggableRel(ManyToManyRel):
class
TaggableManager
(
RelatedField
):
def
__init__
(
self
,
verbose_name
=
_
(
"Tags"
),
through
=
None
):
def
__init__
(
self
,
verbose_name
=
_
(
"Tags"
),
help_text
=
None
,
through
=
None
):
self
.
use_gfk
=
through
is
None
or
issubclass
(
through
,
GenericTaggedItemBase
)
self
.
through
=
through
or
TaggedItem
self
.
rel
=
TaggableRel
(
to
=
self
.
through
.
_meta
.
get_field
(
"tag"
)
.
rel
.
to
)
self
.
verbose_name
=
verbose_name
self
.
help_text
=
help_text
or
_
(
"A comma-separated list of tags."
)
self
.
editable
=
True
self
.
unique
=
False
self
.
creates_table
=
False
...
...
@@ -74,8 +75,8 @@ class TaggableManager(RelatedField):
def
formfield
(
self
,
form_class
=
TagField
,
**
kwargs
):
defaults
=
{
"label"
:
_
(
"Tags"
)
,
"help_text"
:
_
(
"A comma-separated list of tags."
)
"label"
:
self
.
verbose_name
,
"help_text"
:
self
.
help_text
,
}
defaults
.
update
(
kwargs
)
return
form_class
(
**
defaults
)
...
...
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