Sorry, I guess I should have looked a bit harder before posting this
question,
I've figured it out.
Hopefully this will be of help to someone else.
the discussion here:
http://stackoverflow.com/questions/8925434/django-class-based-generic-views-url-variable-passing
answers my question.
The URL parameters are not available directly as a class attribute in the
class based generic view
but they can be accessed indirectly in the get_queryset method as so:
def get_queryset(self):
model_group_id=self.kwargs['model_group_id']
( where 'model_group_id' is the URL parameter being accessed )
On Friday, March 22, 2013 8:06:06 AM UTC-4, Doug S wrote:
>
> I'm new to using generic views and the genericness is obviously powerful,
> but I'm wondering how far it goes. If I have a model and want to display
> it as a list,
> I can use a generic view and even specify the query set it displays for a
> given view,
> but what if I want to constrain the query set through a url parameter?
> Is that beyond the scope of generic views?
> Can the url parameters be passed to the class based view?
> Best
> Doug
>
>
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.