Re: Custom option for Model Meta Options

2012-03-27 Thread Roman Klesel
Hello Anssi, thanks! Seems to work. I tried it like this: from django.db import models class MyModelBase(models.base.ModelBase): def __new__(cls, name, bases, attrs): attr_meta = attrs.pop('Meta', None) try: has_cpk= attr_meta.has_composite_primary_key

Re: Custom option for Model Meta Options

2012-03-26 Thread akaariai
On Mar 26, 12:26 pm, Roman Klesel wrote: > Hello, > > in my App I would like some Models to accept some custom Meta options like > this: > > class MyModel(models.Model) > >   name = models.CharField(...) >   other = models.CharField(...) >   more = models.C

Custom option for Model Meta Options

2012-03-26 Thread Roman Klesel
Hello, in my App I would like some Models to accept some custom Meta options like this: class MyModel(models.Model) name = models.CharField(...) other = models.CharField(...) more = models.CharField(...) class Meta: db_table = "my_table" custom_option = True It woul

Proxy models and Meta options

2010-08-17 Thread Mathieu Leduc-Hamel
Hi all, I've just used a proxy model in my own custom application and i've just found a small problem. Right now, to be able to create a Proxy model, i'm force to redefine a Meta options like that: class NewDiscount(Discount): class Meta: proxy = True The problem i h

How do you create custom Meta Options ?

2008-09-14 Thread lphm
Hi! Just like permission options, I would like to provide an option called "menus" used in my App Models. For example, if I write this in my model class : class Meta: permissions = {.} I'd like to write this for "menus" : class Meta: menus = {.} OR in a options.py file, I'd like

Meta options`

2007-08-27 Thread Lic. José M. Rodriguez Bacallao
how can I add my custom options to the Meta model class? -- Lic. José M. Rodriguez Bacallao Cupet - Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo. Recuerda: El arca de Noe fue construida por aficionado