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.CharField(...) > >   class Meta: > >    

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 would be quite