Skip to content
This repository has been archived by the owner on Jun 17, 2018. It is now read-only.

Commit

Permalink
Modified TagField's __init__ to take and pass *args along
Browse files Browse the repository at this point in the history
git-svn-id: https://django-tagging.googlecode.com/svn/trunk@134 83e7428b-ec2a-0410-86f2-bf466d0e5e72
  • Loading branch information
insin committed Apr 30, 2008
1 parent 2215852 commit e70bf05
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tagging/fields.py
Expand Up @@ -17,11 +17,11 @@ class TagField(CharField):
"under the hood". This exposes a space-separated string of tags, but does "under the hood". This exposes a space-separated string of tags, but does
the splitting/reordering/etc. under the hood. the splitting/reordering/etc. under the hood.
""" """
def __init__(self, **kwargs): def __init__(self, *args, **kwargs):
kwargs['max_length'] = kwargs.get('max_length', 255) kwargs['max_length'] = kwargs.get('max_length', 255)
kwargs['blank'] = kwargs.get('blank', True) kwargs['blank'] = kwargs.get('blank', True)
kwargs['validator_list'] = [isTagList] + kwargs.get('validator_list', []) kwargs['validator_list'] = [isTagList] + kwargs.get('validator_list', [])
super(TagField, self).__init__(**kwargs) super(TagField, self).__init__(*args, **kwargs)


def contribute_to_class(self, cls, name): def contribute_to_class(self, cls, name):
super(TagField, self).contribute_to_class(cls, name) super(TagField, self).contribute_to_class(cls, name)
Expand Down
2 changes: 1 addition & 1 deletion tagging/tests/models.py
Expand Up @@ -35,4 +35,4 @@ class Meta:
ordering = ['name'] ordering = ['name']


class FormTest(models.Model): class FormTest(models.Model):
tags = TagField() tags = TagField('Test', help_text='Test')

0 comments on commit e70bf05

Please sign in to comment.