I can't find any documentation on pagenation being used with forms.. would this all be better achieved with jquery? I have no experience with that but I would think that it would be possible to display the first set of questions, then upon the click of a button, that set of questions are hidden and the next set are shown for the next day and so on?
This way I combine all 4 tables into one, I just have to figure out how to work the form with jquery if this is even possible. On Tuesday, December 22, 2015 at 9:04:57 AM UTC-8, [email protected] wrote: > > I have a form that opens a excel file template, all inputs in the form > correlate to a cell within the template. When the form is submitted, the > new excel file is saved for that user. > > I am trying to find the best way to implement the following: > > I want to open the existing uploaded file, and edit different cells within > it. > > Basically, I want multiple tables for the same form, but I am not sure how > to append the table to the existing uploaded file. > > Example: > Excel file consists of data regarding user and 3 days. > Table one is a form for basic user information. > Table 2 is a form for Day 1, user can click submit and then may be > redirected to Day 2 which is table 3, submit and is redirected to table 4 > which is Day 3 and the final submit has one excel file with data > correlating to Day 1, Day 2 and Day 3 and the users information. > > > I eventually intend to store the data using a blob field, if that will be > possible. > Do I need to use sqlform.factory? Migrations? > > I am stuck because depending on which day the user is submitting > information for, cal_calc will differ because it will input the information > in different cells, but within the same excel workbook. > > > I am having trouble finding documentation that helps most with this, I > have looked into pagination, is_in_db documentation, but nothing really > explaining how to reference something within an upload field in this way. > > Anything will help, whether its redirecting me to documentation that will > help me achieve this or an example of some sort, if this is even something > possible to do. > > Below I have what I am currently trying out (although I think it is > redundant because the same fields are required for each day, so having 3 > different tables for the same information seems excessive) , but I am > unable to even test if it works because I am getting the error: > <type 'exceptions.NameError'>(name 'db' is not defined) > > I don't understand why, my other model files with tables do not have this > issue. > > > *Model:* > > def cal_calc(row): > from openpyxl import load_workbook > from openpyxl.writer.excel import save_virtual_workbook > from cStringIO import StringIO > import os > wb = load_workbook(filename= os.path.join(request.folder, 'static', > 'calcalc.xlsx')) > cells = wb['week1'] > cells['A1'] = row.first_name > cells['B1'] = row.last_name > cells['C1'] = row.age > cells['D1'] = row.thedate > cells['A2'] = row.first_meal1 > cells['A3'] = row.first_calories1 > cells['A4'] = row.second_meal1 > cells['A5'] = row.second.calories1 > cells['A6'] = row.third_meal1 > cells['A7'] = row.third_calories1 > cells['B2'] = row.first_meal2 > cells['B3'] = row.first_calories2 > cells['B4'] = row.second_meal2 > cells['B5'] = row.second.calories2 > cells['B6'] = row.third_meal2 > cells['B7'] = row.third_calories2 > cells['C2'] = row.first_m > ... -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.

