On Feb 23, 2006, at 8:12 AM, Jason F. McBrayer wrote:
> > "Chetan Vaity" <[EMAIL PROTECTED]> writes: > >> I want to build a two-page form for creating an object. As I see >> it there are two options: >> 1. Store values in hidden fields >> 2. Use the session to store the variables from the first form >> >> Any Django best practices? > > I'd say use the session to store the values from the first form. If > you use hidden fields, they could be modified by the user after > submitting the first page. That would just mean that you'd need to do > all your validation in the view handling the second page, but for UI > reasons you probably want to do validation of a field on the page > where the user actually entered it. Why not just store the values in the database after each pages submission? You then give the ability to come back to it at a much later date... I guess technically using sessions would be doing this in django, but then you're doing a ton more work. Why? well, you'd be pulling all the data from the session just to reinsert it into the "survey (or whatever)" table anyway. Just put it in the survey table as it comes in. But the point is that your only overhead is having an extra column, rather than multiple unnecessary inserts to the database. --- Andrew Gwozdziewycz [EMAIL PROTECTED] http://ihadagreatview.org http://and.rovir.us --~--~---------~--~----~------------~-------~--~----~ 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 unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~----------~----~----~----~------~----~------~--~---