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 =
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?
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
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
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
5 matches
Mail list logo