[web2py] How to get rows in right format

2016-04-30 Thread Marko Seppälä
Hi, I have a database where following structure is quite common: db.define_table('thing', Field('name) ) db.define_table('property', Field('name) ) db.define_table('thing_has_property', Field('thing_id', 'reference thing'), Field('property_id', 'reference property'),

[web2py] Re: How to get rows in right format

2016-04-30 Thread Pierre
this might help: *db.define_table('thing_has_property', Field('property_ids','list:reference property')*it allows you to manage properties order like so : p1 = row.property_ids[0], p2=row.property_ids[1]...etc -- Resources: - http://web2py.com - http:/

[web2py] Getting dates of the week

2016-04-30 Thread Wayne Tooley
Hi Everyone; I hardly ever post as I can usually find answers to my questions but I have been having a hard time with this datetime stuff. When I run the code in db1.py (minus the databse code) with pycharm I get the correct results. Running it in Web2py I get the correct dates but it gives 3 se

[web2py] Re: Getting dates of the week

2016-04-30 Thread Wayne Tooley
Answer: db.define_table('datein', Field('date_in'), ) def days_of_week(): import datetime from datetime import date, timedelta import calendar weekNumber = date.today().isocalendar()[1] today = datetime.date.today() td = str(today) dt = datetime.datetime.strpt

[web2py] I removed navbar from layout and implemented in view like this but I don't get toggle in mobile view

2016-04-30 Thread Steve Joe
I want toggle navigation button when opened from mobile and not like this. My code in index.html: {{if response.menu:}} {{=response.logo or ''}} {{=MENU(response.menu, _class='nav navbar-nav',li_class='dropdown',ul_class='dropdown-menu')}}