Add Fields to tables using loops

50 views
Skip to first unread message

Nurendra Choudhary

unread,
Oct 3, 2014, 7:26:49 PM10/3/14
to web...@googlegroups.com
Hi,
Firstly, thanks for such a great framework.

I wanted to know how to add fields to tables using loops.

I require a table with all dates of a year as Fields.

Please help me...........

Niphlod

unread,
Oct 4, 2014, 2:32:45 PM10/4/14
to web...@googlegroups.com
fields = []
for a in range(10):
    fields.append(Field(...))

db.define_table(*fields)

but before diving in, what on earth requires such a model ?

Nurendra Choudhary

unread,
Oct 4, 2014, 7:11:22 PM10/4/14
to web...@googlegroups.com
A calendar with flag for each user

Niphlod

unread,
Oct 7, 2014, 6:34:41 AM10/7/14
to web...@googlegroups.com
I'd urge you to consider a table with 2 fields, "date" and "user" instead.

Leonel Câmara

unread,
Oct 7, 2014, 6:49:39 AM10/7/14
to web...@googlegroups.com
I urge you to follow Niphlod's advice.
Reply all
Reply to author
Forward
0 new messages