from tagging.fields import TagField

class Post(models.Model):
    ....
    tags = TagField()

#in your template. For example, object_details
{% load tagging_tags %}

{% tags_for_object object as tag_list %}

{% if tag_list %}
      Tags:
        {% for tag in tag_list %}
        {{ tag }}{% if not forloop.last %}, {% endif %}
        {% endfor %}
  {% endif %}


Hope this help,

Chatchai
2008/5/28 mwebs <[EMAIL PROTECTED]>:

>
> Hi Alex,
>
> I was trying to use this, but I got an no-attribute-tag-field-error...
> I also tried tagging.TagField() and models.TagField()
>
> Any idea?
>
> On 28 Mai, 08:05, "Alex Ezell" <[EMAIL PROTECTED]> wrote:
>  > On Wed, May 28, 2008 at 1:00 AM, mwebs <[EMAIL PROTECTED]>
> wrote:
> >
> > > My problem is that a.tags returns a list with tag objects.But what I
> > > need is a String of concatenated String like
> >
> > > 'cool, funky, fresh, exiting'
> >
> > > Has anybody an idea how to do this without iterating over the list of
> > > tagobjects and concatenating them by hand?
> >
> > Toni,
> > Have you looked at using the TagField in the model which you are
> > tagging. This makes it really easy to get these values as an attribute
> > of the model which you are tagging.
> >
> > /alex
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to