[web2py] Re: Manipulating Items in DropDown List using SQLFORM

2016-09-15 Thread Brian Boatright
In my models.py where I setup the database tables I have a row db.define_table('item', Field('parentid','integer', label='Part of'), Field('itemtypeid', db.itemtypes, required=True, requires=IS_IN_DB(db,db.itemtypes,'%(name)s',orderby='id',error_message='Select

[web2py] Re: JSON getting the series data into view

2016-09-13 Thread Brian Boatright
Make sure you are using the correct URL to retrieve the data. I just did a test of that example from the book by creating a controller and index view and it works as expected. In your original post you show $.getJSON('/application/default/weekdays', and in your last reply you suggest you

[web2py] Re: Manipulating Items in DropDown List using SQLFORM

2016-09-05 Thread Brian Boatright
That makes sense but doesn't IS_IN_DB create foreign keys in database or other relationships between the tables that might be effected? On Sunday, September 4, 2016 at 5:08:23 AM UTC-4, Brian Boatright wrote: > > I'm using SQLFORM and was able to add an orderby to the original model &

[web2py] Manipulating Items in DropDown List using SQLFORM

2016-09-04 Thread Brian Boatright
I'm using SQLFORM and was able to add an orderby to the original model class to sort a resulted dropdown list sqlform was generating. Ideally I need to limit the items in the dropdown list by id to be id > 10, as the first 10 are static types and those over id 10 are user generated and

[web2py] "conent" instead of "content" and double nesting using db.parse_as_rest

2016-09-02 Thread Brian Boatright
I was building out a simple API and found a few issues with the output build using the experimental "parse_as_rest" feature. I'm using Telerik KendoUI Grid which is pretty robust and something we already use on C# MVC projects so I have some experience and help from my co-workers when I miss

[web2py] Re: Cannot Create Table Named "Items" - Already Exists

2016-09-01 Thread Brian Boatright
so it's just something in the web2py code base that has a problem with the word "items" as a database table name. -- 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

[web2py] Re: Cannot Create Table Named "Items" - Already Exists

2016-09-01 Thread Brian Boatright
thanks to Yoel pointing out that "item" works I just changed the table name to "item" instead of "items" but I would really like to see this issue fixed or at least explained. it's either a bug or a reserved word that isn't being detected correctly. Thanks all for the help so far. --

[web2py] Re: Cannot Create Table Named "Items" - Already Exists

2016-09-01 Thread Brian Boatright
indeed! I'm new to web2py and python. if I knew a bit more I would try to edit the base.py function for define_table that might give some more details. the error stops right on line 819 of base.py. would be good to have self.tables print out as part of the error or even directly on the page.

[web2py] Re: Cannot Create Table Named "Items" - Already Exists

2016-09-01 Thread Brian Boatright
I haven't figured out how to get an interactive console on my windows machine BUT I did upload the package to pythonanywhere and used their bash shell. The only tables created were the standard authentication tables.

[web2py] Re: Cannot Create Table Named "Items" - Already Exists

2016-09-01 Thread Brian Boatright
just to be sure it wasn't some odd cache issue or something I missed I created a brand new simple app in the admin called "forum" and created a new model file models.py and created a very basic items table. # -*- coding: utf-8 -*- > db.define_table('items', >

[web2py] Re: Cannot Create Table Named "Items" - Already Exists

2016-09-01 Thread Brian Boatright
I always delete the database in mysql and create it again (no tables). Then delete all the files in the database folder. When it runs again, as far as I know, everything is clean. My connection string is just a simple > uri: mysql://root:password@localhost/project and I don't see anything

[web2py] Cannot Create Table Named "Items" - Already Exists

2016-09-01 Thread Brian Boatright
Is "items" a keyword for Python or Web2py? I'm using mysql and having web2py models file define a new table named "items" but it gives me an error that says the table already exists. If I change the name of the table to something like "items2" in the models.py file it works. The mysql

[web2py] Re: Reddit clone source code?

2016-08-29 Thread Brian Boatright
https://github.com/mdipierro/web2py-recipes-source/tree/master/source/02_building_your_first_applications/03_building_a_reddit_clone and the source code for the book is on github as well https://github.com/mdipierro/web2py-recipes-source/tree/master/source -- Resources: - http://web2py.com -

[web2py] Re: Is 'Container' a Reserved Word?

2016-08-29 Thread Brian Boatright
preferred the models in separate files, but maybe that's not possible when they have so many foreign keys. Is it possible to stage the order which the model files are read so table declarations will be in the right sequence? On Sunday, August 28, 2016 at 8:41:17 PM UTC-4, Brian Boatright wrote

[web2py] Is 'Container' a Reserved Word?

2016-08-28 Thread Brian Boatright
I've tried adding a model for "Containers" and "ContainerTypes" each time I get an error when it tries to create the tables when I click the Database Admin button. The other tables I'm defining are working fine. I have a few other tables that have "Type" in their mode/table name so when I

[web2py] Making web2py AVailable in Softaculous

2016-08-16 Thread Brian Boatright
I've been using nosupportlinuxhosting for a while and with good success. At $1 per website per month it's a bargain for project sites and development. They use cPanel and one of the features of Cpanel is Softaculous to make setting up a LOT of popular web software and frameworks available