Eric, I tried use sessions but have error, becouse as I understood session 
can't store user class objects. *"Don't store user-defined classes in 
session"* - in book. Then I serialised object to json like that: 
json.dumps(temp_double_class.__dict__) and in my fubction use that code:

def importTimetable():
    #form code

    #parser code
    if form.process().accepted:

       filesLinesList = [line.strip().decode() for line in form.vars.ttFile.
file]

        double_class_list = parseExcelCsv(filesLinesList, 
int(form.vars.HALF_YEAR), int(form.vars.FAC))

       session.double_class_list = double_class_list
        redirect(URL('Timetable', 'default', 'findSubjectsId'))
    return dict(form=form, test=test)


def findSubjectsId():
    import json
    from collections import namedtuple
    double_class_list = list()
    for x in session.double_class_list:
        double_class_list.append(json.loads(x, object_hook=lambda d: 
namedtuple('DoubleClass', d.keys())(*d.values())))

    test = ""
    for x in double_class_list:
        test += f"tt_id - {x.tt_id}, dc_number - {x.dc_number}, dc_day - {
x.dc_day}, dc_type - {x.dc_type}, " \
                f"subject_id - {x.subject_id}, teacher_id - {x.teacher_id}, 
building_id - {x.building_id}, " \
                f"class_room_id - {x.class_room_id}, subgroup - {x.subgroup}, 
dc_week - {x.dc_week}, " \
                f"dc_queue - {x.dc_queue};<br>"
    test = XML(test)
    return dict(test = test)

If somebody know more useful case share it, please.

-- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/f9edb4a4-0323-4162-9b91-faf86dbd9906%40googlegroups.com.

Reply via email to