1 # -*- coding: utf-8 -*-
3 Tagging utilities - from user tag input parsing to tag cloud
8 def get_queryset_and_model(queryset_or_model):
10 Given a ``QuerySet`` or a ``Model``, returns a two-tuple of
13 If a ``Model`` is given, the ``QuerySet`` returned will be created
14 using its default manager.
17 return queryset_or_model, queryset_or_model.model
18 except AttributeError:
19 return queryset_or_model._default_manager.all(), queryset_or_model
22 def get_tag_list(tags):
24 Utility function for accepting tag input in a flexible manner.
26 If a ``Tag`` object is given, it will be returned in a list as
29 from newtagging.models import TagBase
30 if isinstance(tags, TagBase):