Create generic views in Django 0.91

2006-06-13 Thread Sam Tran
Hi All, We are working on a service provisioning workflow interface using Django 0.91. We wrote some views that are being used to create/modify/delete manager/subordinates relationships with or without inheritance (Manager can also manage a subordinate's subordinates). We can also visualize the

Re: Create generic views in Django 0.91

2006-06-14 Thread Adrian Holovaty
On 6/13/06, Sam Tran <[EMAIL PROTECTED]> wrote: > Now we want to use the same model to create a contact tree for a given > user: we determine who this user can view, e.g. personal phone > numbers. The tables have different name but have the same function. > Obviously we'd like to use the same view

Re: Create generic views in Django 0.91

2006-06-16 Thread Sam Tran
On 6/14/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > > On 6/13/06, Sam Tran <[EMAIL PROTECTED]> wrote: > > Now we want to use the same model to create a contact tree for a given > > user: we determine who this user can view, e.g. personal phone > > numbers. The tables have different name but h

Re: Create generic views in Django 0.91

2006-06-16 Thread Adrian Holovaty
On 6/16/06, Sam Tran <[EMAIL PROTECTED]> wrote: > As for my initial question I apologize for the confusion, I didn't > mean to use the generic views as described in the Django tutorials. I > want to be able to make some functions generic. Please let me give you > an example: http://paste.e-scribe.

Re: Create generic views in Django 0.91

2006-06-16 Thread Sam Tran
On 6/16/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > > On 6/16/06, Sam Tran <[EMAIL PROTECTED]> wrote: > > As for my initial question I apologize for the confusion, I didn't > > mean to use the generic views as described in the Django tutorials. I > > want to be able to make some functions gen

Re: Create generic views in Django 0.91

2006-06-16 Thread Adrian Holovaty
On 6/16/06, Sam Tran <[EMAIL PROTECTED]> wrote: > Wow! I didn't know it would be that simple! > > What about convenience functions, get_relatedobjectname()? > Can 'relatedobjectname' be a field name passed as a parameter? Yes, you can pass that in dynamically. For that example, you'd do this:

Re: Create generic views in Django 0.91

2006-06-16 Thread Jeremy Dunck
On 6/16/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > Note that this is just Python -- there's nothing Django-specific about > these examples. Isn't Python the best? :) I find that in Python, the main obstacle between my thoughts and simple code that does exactly what I want is generally my ow

Re: Create generic views in Django 0.91

2006-06-16 Thread Sam Tran
On 6/16/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > > On 6/16/06, Sam Tran <[EMAIL PROTECTED]> wrote: > > Wow! I didn't know it would be that simple! > > > > What about convenience functions, get_relatedobjectname()? > > Can 'relatedobjectname' be a field name passed as a parameter? > > Yes,