r/Python • • Apr 27 '10

Beginners question about good design. Web2py.

I am putting together a site, from scratch, that is a cross between craigslist/yelp/travelocity. Basically there are multiple categories such as tutoring / computer repair / house related / etc.

When I am creating the model (database tables/etc) should I try to create a comprehensive submit form for all categories, or individual submit forms for each category? Some fields in one category have no meaning in another category. For example in tutoring there is an "Instructor-to-Student Ratio" field, and in computer repair there are Operating System type fields "apple, windows, linux etc."

Also some of the categories might have "sub-categories." Tutoring might have physical training, and educational, which in turn might have karate, ninjitsu, and math / science respectively.

What do the tables (in the model/DB) look like for this sort of a site?

0 Upvotes

8 comments sorted by

View all comments

2

u/mdipierro Apr 27 '10

I am sorry you get voted down but reddit is nor very web2py friendly.

My two cents without knowing much about your project. I would create a table category, a table sub-category (that reference category) and I would generate the form dynamically (SQLFORM.factory) based on the list of subcategories.

1

u/yanni Apr 27 '10

Thank you for getting back to me so quickly. I find Web2Py incredibly intuitive for a beginner. Not sure why reddit isn't web2py friendly. The idea for any development environment is simplicity, right?