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