tags:

views:

86

answers:

2

I have a table of person and a table of events. I want to find a person in a dropdown, select that person and then display all events for that person.

I am confused about what commands to use. I get a lot of syntax errors. Any help will be appreciated Thanks

A: 

Much more info required! - database you are using - what you have tried - what errors you are getting

A: 

You probably want to use the form API and ORM. I'm guessing that you have a event model with a foreign key a person/user model.

Step one: Create a form or modelform to make the user able to selecta person. Using a modelform is probably the easiest thing to do.

Step two: Create a view to handle form displayand the response. The main part here is getting the events. Using the ORM something like this would do the trick.

Queryset = Event.objects.filter(person=the_person_the_user_selected_in_form)

Then all you need to do is to display the data however you like.

googletorp