Re: A small bug for dynamic choices

2013-02-14 Thread vijay shanker
code is getting executed when Django validates it's models. Hence, Cartprobably has not been validated yet and it's model class is None. On Monday, February 11, 2013 4:29:44 PM UTC+5:30, vijay shanker wrote: > > hi > i wrote a function for producing tuples of all model names, which is this: >

Re: A small bug for dynamic choices

2013-02-11 Thread vijay shanker
I found out that ('shoppingcart.models.Cart', 'Cart') is lost coz it doesnot finds any model_class (i.e model_class is None and is thus filtered out ) when i am running the code but it does finds the model_class from python shell. something which is not very obvious is happening. On Monday, F

A small bug for dynamic choices

2013-02-11 Thread vijay shanker
hi i wrote a function for producing tuples of all model names, which is this: from django.contrib.contenttypes.models import ContentType from django.db.models.loading import get_model def get_all_models(): return tuple([(each.__module__+'.'+each.__name__,each.__name__) for each in [each.mode