Hi all you Django users and developers!

I have a question about RSS framework in Django. I want basic RSS.
Nothing custom nothing advanced. Just RSS from my model for last 10
imports in model. This is what i got:

##### Model:

class Koda(models.Model):
        naslov = models.CharField(max_length=50)
        slug = models.SlugField(max_length=255,blank=True,null=True)
        koda = models.TextField()
        dodano = models.DateTimeField(default=datetime.datetime.now ,
blank=True)
        avtor = models.ForeignKey(User)

        @permalink
        def get_absolute_url(self):
                return ('koda_view', [self.slug])

        def __unicode__(self):
                return self.jezik.ime + ' / '+ self.naslov

#####  RSS Model:

class SvezaKoda(Feed):
        title = "Rss title..."
        link = "/rss/"
        description = "Description..."

        def items(self):
                return Koda.objects.order_by('-dodano')[:10]

        def item_link(self,item):
                return '/'+ item.jezik.slug + '/' + item.slug

        def item_author_name(self,item):
                return item.avtor

        def item_pubdate(self,item):
                return item.dodano

##### URLs:

feeds = {
    'koda': SvezaKoda,
}

urlpatterns = patterns('',
        (r'^rss/(?P<url>.*)/$', 'django.contrib.syndication.views.feed',
{'feed_dict': feeds}),
...

---------------

Now. This works. But in content field i don't get content that i want.
I want the field "koda" to be shown inside RSS content field. Insted
of the content inside rss item i get value of __unicode__

Can someone please help me.

Oto

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
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