Re: Overriding flatpages class meta

2010-08-31 Thread Owen Nelson
Actually, I would *avoid* modifying the flatpages source, but that does raise a good point -- look at the source and copy/paste the Meta defined inside the class, making the overrides you need in your subclass (redefine the Meta). You'll have to watch for changes if/when you switch django

Re: Overriding flatpages class meta

2010-08-31 Thread Karim Gorjux
Try to modify the flatpages source! You can find it directly in your django installation. -- Karim Gojux www.karimblog.net -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To

Re: Overriding flatpages class meta

2010-08-31 Thread Owen Nelson
The meta class instance is accessed through ClassName._meta -- not ClassName.meta I tried this when I got back last night and had (other) issues myself, so this might not be the right approach anyway. -- You received this message because you are subscribed to the Google Groups "Django users"

Re: Overriding flatpages class meta

2010-08-31 Thread Goran
Thanks Owen but is doesn't work. The similar Error message: contribute_to_class if self.meta: AttributeError: 'Options' object has no attribute 'meta' On Aug 30, 8:03 pm, Owen Nelson wrote: > Sorry to be guessing here, but I was looking at something similar recently. > My

Re: Overriding flatpages class meta

2010-08-30 Thread Owen Nelson
Sorry to be guessing here, but I was looking at something similar recently. My attempt (untested at this point) would be something like: from copy import copy class NewFlatpage(FlatPage): _meta = copy(FlatPage._meta) _meta.verbose_name_plural = "foo" -- You received this message because

Re: Overriding flatpages class meta

2010-08-30 Thread Goran
I was try class Meta(FlatPage.Meta): but when runserver there is following error: AttributeError: type object 'FlatPage' has no attribute 'Meta' any other solution to try? Thanks On Aug 30, 12:53 am, Steve Holden wrote: > On 8/29/2010 6:51 PM, Goran wrote: > > >

Re: Overriding flatpages class meta

2010-08-29 Thread Steve Holden
On 8/29/2010 6:51 PM, Goran wrote: > Thanks for the answer Steve. I'm Django and Python novice and here is > what I was try. But it doesn't work. > > from django.contrib.flatpages.models import FlatPage > > class NewFlatpage(FlatPage): > > class Meta: The Meta class would need to subclass

Re: Overriding flatpages class meta

2010-08-29 Thread Goran
Thanks for the answer Steve. I'm Django and Python novice and here is what I was try. But it doesn't work. from django.contrib.flatpages.models import FlatPage class NewFlatpage(FlatPage): class Meta: verbose_name_plural = "New_name" On Aug 26, 4:39 am, Steve Holden

Re: Overriding flatpages class meta

2010-08-25 Thread Steve Holden
On 8/25/2010 8:26 PM, Goran wrote: > I need another verbose_name_plural for Flat pages so i need to > override class meta for it right? How can I do that? > [Caveat: this is a guess from general Python knowledge] Have you tried creating a subclass of Flatpage, whose body simply declares a Meta

Overriding flatpages class meta

2010-08-25 Thread Goran
I need another verbose_name_plural for Flat pages so i need to override class meta for it right? How can I do that? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To