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
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
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
&
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
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
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
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.
--
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.
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.
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',
>
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
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
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
-
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
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
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
16 matches
Mail list logo