Hi everyone,
lately i was trying to internationalize a wesite which had flatpages,
but i also needed to translate those pages so i came up with this idea
to get site specific AND language specific flatpages.

I put on the FlatPage class this attribute:

--------
language= models.CharField(maxlength= 7, choices= settings.LANGUAGES)
--------

and in the view i modified this line

--------
f = get_object_or_404(MyFlatPage, url__exact=url,
sites__id__exact=settings.SITE_ID)
--------

to look like this

--------
if = get_object_or_404(MyFlatPage, url__exact=url,
sites__id__exact=settings.SITE_ID, language= request.LANGUAGE_CODE)
--------

What do you think? With this changes, you'll be able to retrieve site
specific and language specific flatpages.

While i was thinking about, it 've been wondering why no one else ever
thought about it and I thought it'd been a good idea to share this
code.

What do you think? Could it be an upgrade for django flatpages module?
Did I miss something or someone else already thought about it?
Let me know.

Cheers,
David


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