コード例 #1
0
ファイル: forms.py プロジェクト: dubirajara/django-tagulous
 def _prepare_tag_options(self, tag_options):
     """
     Force max_count to 1
     """
     return tag_options + options.TagOptions(
         max_count=1,
     )
コード例 #2
0
ファイル: forms.py プロジェクト: dubirajara/django-tagulous
    def __init__(self, tag_options=None, autocomplete_tags=None, **kwargs):
        """
        Takes all CharField options, plus:
            tag_options         A TagOptions instance
                                If not provided, uses Tagulous defaults
            autocomplete_tags   Iterable of tags to be used for autocomplete,
                                ie a queryset from a TagModel, or a list of
                                strings. Will be ignored if tag_options
                                contains autocomplete_view
        """
        # Initialise as normal
        super(BaseTagField, self).__init__(**kwargs)

        # Add tag options and autocomplete tags
        # Will use getters and setters to mirror onto widget
        self.tag_options = tag_options or options.TagOptions()
        self.autocomplete_tags = autocomplete_tags
コード例 #3
0
ファイル: forms.py プロジェクト: dubirajara/django-tagulous
 def _prepare_tag_options(self, tag_options):
     "Clone tag options"
     return tag_options + options.TagOptions()