[web2py] Caught out by python/web2py syntax

2017-05-16 Thread Carl Hunter Roach
I had (something like) the following code: In db.py a table called "point" In a controller: # points is a list of dicts defining rows in table point for point in points: db.point.insert(**point) The code would disappear inside db.point.insert without throwing an exception.

[web2py] Re: Caught out by python/web2py syntax

2017-05-16 Thread Anthony
> > # points is a list of dicts defining rows in table point > for point in points: > db.point.insert(**point) > > The code would disappear inside db.point.insert without throwing an > exception. > It's not clear what the above sentence means. > The table point would receive

[web2py] Re: How do I troubleshoot this? (DAL)

2017-05-16 Thread Anthony
On Monday, May 15, 2017 at 10:09:18 PM UTC-4, lyn2py wrote: > > I had a setup that was working. But it's broken after I changed the name > of a table. This was what I did: > > >1. Shut down web2py >2. Edit the model - table name + all references to the table name >3. Edit the sqlite -

[web2py] Re: Newbie to Web2Py...Integration with Bootstrap3...PyCharm How-To's

2017-05-16 Thread pbreit
If you're looking to prototype rapidly, forget all that stuff and just build something in a text editor (ie Atom) with the pre-installed Bootstrap. Don't over-complicate it. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source

[web2py] Re: email not sent

2017-05-16 Thread pbreit
Is there some reason you are not setting "sender"? You might need to do this: https://support.google.com/accounts/answer/6010255 -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: Copy & paste images from Wiki page does not work

2017-05-16 Thread Anthony
So what does the index() code look like? On Tuesday, May 16, 2017 at 9:42:23 AM UTC-4, Daniel Vogel wrote: > > I can copy the URL http://localhost:8000/abctest/default/index/1/test.png > direct to the browser and it will open the image with the download message. > If I use the URL from a static

[web2py] Re: Define table but not add it to the database

2017-05-16 Thread Dave S
On Tuesday, May 16, 2017 at 9:34:01 AM UTC-7, lyn2py wrote: > > Thanks Anthony, I'm sorry my question was ambiguous. > > I meant to define a table and to add data to a table that doesn't exist in > the sqlite table, but yet web2py can get the data (I can "hardcode" the > data into the

[web2py] Re: Copy & paste images from Wiki page does not work

2017-05-16 Thread Daniel Vogel
Controller default: @auth.requires_login() def index(): return auth.wiki(force_render=True) On Monday, May 15, 2017 at 4:27:52 PM UTC+2, Daniel Vogel wrote: > > Hi > > I like copy from Wiki page (HTML) to LibreOffice Writer. > If I copy text, it works. With images in the Markmin syntax,

[web2py] Re: How do I troubleshoot this? (DAL)

2017-05-16 Thread lyn2py
I think I found it with Anthony's lead. I opened the sqlite db with a 3rd party browser, and looked for it. I found on many of the tables: "site_id" INTEGER REFERENCES "abcde_sites" ("id") ON DELETE CASCADE abcde_sites is my old table name. how do I change it to the new tablename with web2py?

[web2py] Re: Make an inster/update in a second table after inserting/update

2017-05-16 Thread Anthony
When you do an insert, the .insert() method returns the id of the inserted record. Also, take a look at http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#callbacks-on-record-insert--delete-and-update. Anthony On Tuesday, May 16, 2017 at 1:08:59 PM UTC-4, Santiago

Re: [web2py] Re: Caught out by python/web2py syntax

2017-05-16 Thread Carl Hunter Roach
Sorry about the term "crash". "hang" is more accurate. No ticket is issued and the function db.point.insert does not return although an entry is made into my GAE data store. The the following code works without hanging: for a_point in points: db.point.insert(**as_point) I also

[web2py] Re: How do I troubleshoot this? (DAL)

2017-05-16 Thread Anthony
SQLite only supports changing table names and adding columns. You might consider exporting the tables to CSV, drop the tables and have web2py re-create them, and then import the CSV data (back up the database file before doing any of this). Anthony On Tuesday, May 16, 2017 at 12:48:18 PM

[web2py] Re: Define table but not add it to the database

2017-05-16 Thread lyn2py
Thanks Anthony, I'm sorry my question was ambiguous. I meant to define a table and to add data to a table that doesn't exist in the sqlite table, but yet web2py can get the data (I can "hardcode" the data into the controller or model). How do I achieve that? Or rather can I? Thank you again!

[web2py] Make an inster/update in a second table after inserting/update

2017-05-16 Thread Santiago Cartasegna
Hello, I am having a struggle in doing the following workflow: I have One table wich I need to get the values after insert/Update (I know how to manage this case) to put in another table. In the case of the update, I can make a workaround besacuse I can catch the edit. But when I have a New

[web2py] Re: How do I troubleshoot this? (DAL)

2017-05-16 Thread Pierre
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Exporting-and-importing-data what i 'd do is backup the data rewrite a clean relational model with new tablenames and foreign key constraints then restore data.. -- Resources: - http://web2py.com -

[web2py] Re: Define table but not add it to the database

2017-05-16 Thread Anthony
On Tuesday, May 16, 2017 at 8:16:25 AM UTC-4, lyn2py wrote: > > Is there is a way to define a table without adding it to the sqlite > database? I wish to define a table and have data in that table, but not add > it to the sqlite db. > You can do db.define_table(..., migrate=False). This assumes

[web2py] Re: Copy & paste images from Wiki page does not work

2017-05-16 Thread Anthony
Is the image in question in fact available at the URL http://localhost:8000/abctest/default/index/1/test.png (i.e., if you go to that URL in a browser, does the image appear)? If not, you need to use the correct URL in your Wiki markup. Anthony On Monday, May 15, 2017 at 10:27:52 AM UTC-4,

[web2py] Re: Copy & paste images from Wiki page does not work

2017-05-16 Thread Anthony
Looks like the wiki uses response.download with the default attachment=True. Instead of returning auth.wiki() directly, you might try calling it and then removing "attachment; " from the beginning of the "Content-Disposition" header in response.headers before returning. You can also submit an

[web2py] Re: Define table but not add it to the database

2017-05-16 Thread Anthony
On Tuesday, May 16, 2017 at 12:34:01 PM UTC-4, lyn2py wrote: > > Thanks Anthony, I'm sorry my question was ambiguous. > > I meant to define a table and to add data to a table that doesn't exist in > the sqlite table, but yet web2py can get the data (I can "hardcode" the > data into the

Re: [web2py] Language file on GAE

2017-05-16 Thread Mathieu Clabaut
Couldn't yo run your application in a normal python environment (with a sqlite memory db for example) ? I'm doing that for quick testing phases, before testing in devapp server and in full GAe environment. Thus I'm able to produce the updated language files. Otherwise, I think there is a script

Re: [web2py] Language file on GAE

2017-05-16 Thread Karoly Kantor
Thank you, that's helpful. -- 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] Re: How do I troubleshoot this? (DAL)

2017-05-16 Thread Pierre
> > drop the table in question and save your db.py file again. It should > recreate the table with a new name > http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#drop -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] Re: Copy & paste images from Wiki page does not work

2017-05-16 Thread Daniel Vogel
My preferred environment is Ubuntu. I think it does no matter which "client". I tried both. The controller code is only to initialize the Wiki engine: @auth.requires_login() def index(): return auth.wiki(force_render=True) And the content from the Wiki page: ## Test with Image page content

Re: [web2py] Language file on GAE

2017-05-16 Thread Karoly Kantor
No, my language file is not updated. My local env is set to use Datastore. -- 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

Re: [web2py] Language file on GAE

2017-05-16 Thread Mathieu Clabaut
Yes. When manually visitting the website locally, the files are updated ans then will be uploaded to GAE when deploying. On Mon, May 15, 2017 at 4:53 PM Karoly Kantor wrote: > I understand web2py would generate my language file (e.g. it.py) in > runtime, except on GAE. Now, I

[web2py] Re: How do I troubleshoot this? (DAL)

2017-05-16 Thread lyn2py
I have data in that table that I want to keep. How do I accomplish this? I'm sorry if this seems an easy question, but I am not familiar with importing and exporting data such that the integrity of the data is preserved. Thank you. On Tuesday, May 16, 2017 at 5:01:15 PM UTC+8, Pierre wrote: >

[web2py] Define table but not add it to the database

2017-05-16 Thread lyn2py
Is there is a way to define a table without adding it to the sqlite database? I wish to define a table and have data in that table, but not add it to the sqlite db. The reason is because I have a table with a fixed set of data, that I use across different apps. Thank you! -- Resources: -

[web2py] Re: Copy & paste images from Wiki page does not work

2017-05-16 Thread Daniel Vogel
For clarification, the screen shot is from LibreOffie: Am Montag, 15. Mai 2017 16:27:52 UTC+2 schrieb Daniel Vogel: > > Hi > > I like copy from Wiki page (HTML) to LibreOffice Writer. > If I copy text, it works. With images in the Markmin syntax, LibreOffice > Writer can't render the image

[web2py] How do I insert data from a custom html form into dal created table

2017-05-16 Thread 'hardclock' via web2py-users
Sorry again,the current project I have to make a website with custom form that hard to create using web2py normal form/sqlform. I'm making a form page using html but I don't know how to insert the data into DAL created table,it's a powerful tool and i'd like to keep it for easier database

[web2py] PDF Download File Name

2017-05-16 Thread Paul Ellis
Hello, I use pyfpdf to display some information from my my database. When I click save the filename is 'pdf_view' which is the name of the controller function. How can I change this? I want the name to also come from the database. With the help of others on here. I can make a download link

[web2py] Re: How to get the value of a submitted form in the controller action [URGENT]

2017-05-16 Thread sunda . amran
No i can't get the value i put inside the form if i dont have a database to insert in ... so i sadly create a table and insert the value inside and take it back ... and i read the documentation sadly .. thanks anyway Le lundi 15 mai 2017 14:05:27 UTC+2, Anthony a écrit : > > You've already got

[web2py] Re: Copy & paste images from Wiki page does not work

2017-05-16 Thread Daniel Vogel
I can copy the URL http://localhost:8000/abctest/default/index/1/test.png direct to the browser and it will open the image with the download message. If I use the URL from a static image http://localhost:8000/abctest/static/_2.14.6/images/background.jpg, no download message will pop up, images

[web2py] Re: How to get the value of a submitted form in the controller action [URGENT]

2017-05-16 Thread Anthony
On Tuesday, May 16, 2017 at 4:14:16 AM UTC-4, sunda.am...@gmail.com wrote: > > No i can't get the value i put inside the form if i dont have a database > to insert in > No, that's not true. The ajax() function just needs the names of fields in a form and will post the values of those fields to

[web2py] Re: How do I insert data from a custom html form into dal created table

2017-05-16 Thread Anthony
Check out http://web2py.com/books/default/chapter/29/07/forms-and-validators#Custom-forms. Anthony On Tuesday, May 16, 2017 at 4:02:11 AM UTC-4, hardclock wrote: > > Sorry again,the current project I have to make a website with custom form > that hard to create using web2py normal

[web2py] Re: Make an inster/update in a second table after inserting/update

2017-05-16 Thread Santiago Cartasegna
Thanks for the answer. There is a way to use the facilities of the SmartGrid, and catch the insert? I am able to make a workaround using the One-Form-Multiple-Tables stile but using the data of the form of one table making a new Insert with the data (I see I am on the right course reading the

[web2py] somewhat OT -- log maintenance

2017-05-16 Thread Dave S
I'm using rocket and also the usual logging methods on an AWS linux system. This means httpserver.log is in the web2py directory, and the logs/web2py.log is below the web2py directory. Traffic is still low, so log rotation doesn't need to happen frequently, and can be done manually, but I've