On Thu, 2007-05-10 at 00:05 -0700, Bryan Veloso wrote:
> > The secret is to look in the syndication documentation and search for
> > the word "pubdate". There, it talks about the item_pubdate() method that
> > can be used to generate the date for a single item.
> 
> I tried that, it'd be...
> 
> def item_pubdate(self)
>     return Entry.pub_date
> 
> But it'd give me errors about things being stupid. o_O;
> Okay, errors about the object not having an attribute of pub_date.

Remember that there are multiple ways to specify the publication date
for items. The method you are creating above is one of the two ways to
supply a publication date that is the same for every item in the feed.
It should return a string that is the date you work in some fashion (not
based on individual items).

If you want the publication date to depend on the item, you want the
first type of method described in the documentation (you are using the
second type) in the item_pubdate section:

        def item_pubdate(self, item):
            return item.pub_date
        
Notice that this method receives the Entry instance that you can use to
create the date. Your first example, above, tried to extra the attribute
from the model class, not an instance.

Regards,
Malcolm



--~--~---------~--~----~------------~-------~--~----~
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