Maybe this could help:
http://www.djangosnippets.org/snippets/1187/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscri
Use ContentType. Read about it in django documentation
On Nov 8, 2:03 am, Alistair Marshall <[EMAIL PROTECTED]>
wrote:
> On Nov 7, 4:19 pm, Gerard flanagan <[EMAIL PROTECTED]> wrote:
>
> > I don't know if it's clever or stupid, but this is what I have done in a
> > similar situation:
>
> It appea
On Nov 7, 4:19 pm, Gerard flanagan <[EMAIL PROTECTED]> wrote:
> I don't know if it's clever or stupid, but this is what I have done in a
> similar situation:
>
It appears to be a nice solution - it throws an error If I try to
get_related() on a generic non-specialised place rather than just
ret
Alistair Marshall wrote:
> As I said, I have the function named the same in each child class but
> I need to be able to access it from a list of all the Places.
>
> My current thinking is just a long list of try, except: statements
> attempting to call the subclass from the Place model but this f
On 07/11/2008, at 3:01 AM, Alistair Marshall wrote:
On Nov 6, 2:22 pm, Thomas Guettler <[EMAIL PROTECTED]> wrote:
> If all worker classes (cook, waiter, ...) are subclassed from Worker,
> something like this should work: Worker.objects.filter(workplace=...)
>
Unfortunately the function that ea
On Nov 6, 2:22 pm, Thomas Guettler <[EMAIL PROTECTED]> wrote:
> If all worker classes (cook, waiter, ...) are subclassed from Worker,
> something like this should work: Worker.objects.filter(workplace=...)
>
Unfortunately the function that each child will run is a bit more
complicated than just l
I have never used model inheritance, but I read the documentation
If all worker classes (cook, waiter, ...) are subclassed from Worker,
something like this should work: Worker.objects.filter(workplace=...)
(Given that workers only work for one workplace)
HTH,
Thomas
Alistair Marshall sch
Using the example in the django writing models documentation [1] I
wish to get a list of all the places, then calculate a value that
depends on what the type of place it is.
Say in my restraunt I have a function get_workforce() which returns a
list of all the people that work in the restaraunt. T
8 matches
Mail list logo