Re: Model inheritance - filtering base model only

2009-11-23 Thread esatterwh...@wi.rr.com
a simple solution would be to put pass the contentype id and object id around in your url scheme domain.com/ct_id-object_id/ from there you can get the content type, which will be able to tell you the model, type, and give you the object. type = ContentType.objects.get(pk=ct_id) model =

Re: Model inheritance - filtering base model only

2009-11-23 Thread Doug Blank
On Mon, Nov 23, 2009 at 9:09 AM, lfrodrigues wrote: > I guess this solution works but for +50 the performance should be > terrible... > > Shouldn't django have some option for this? Could you set a field's value which is true for one, and false for the other?

Re: Model inheritance - filtering base model only

2009-11-23 Thread lfrodrigues
I guess this solution works but for +50 the performance should be terrible... Shouldn't django have some option for this? On 23 Nov, 04:53, Preston Holmes wrote: > Perhaps there is a more efficient way, but in my quick test, one can't > filter() a queryset based on

Re: Model inheritance - filtering base model only

2009-11-22 Thread Preston Holmes
Perhaps there is a more efficient way, but in my quick test, one can't filter() a queryset based on __class__ of the model, but seems one can manually filter it afterwords: qs = Player.objects.all() for i,obj in enumerate(qs): if obj.__class__ != Player: del(qs[i]) On Nov 22, 4:32 

Model inheritance - filtering base model only

2009-11-22 Thread lfrodrigues
Hello, I have these models: class Player(models.Model): . class PlayerM(Player): ... If I do PlayerM.objects.all() e get all PlayerM objects and for Player.objects.all() I get all Player and PlayerM as expected. How can get only the objects of type Player (only retrieve the