Re: [web2py] Re: web2py Complete Reference Manual

2015-04-08 Thread Johann Spies
On 4 April 2015 at 13:57, José Ricardo Borba jrborba...@gmail.com wrote: We left summer few weeks ago. It's late? ;-) As a South African, I enjoyed your remark! :) Regards Johann -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py

Re: [web2py] Re: post does not appear in this forum, why ?

2015-04-08 Thread Anthony
On Wednesday, April 8, 2015 at 5:01:22 AM UTC-4, Ramos wrote: It does not make any sense to approve every post from a new user. Why dont you just approve the user ? Typically, the user should be approved upon the first post (as long as it's not spam). Anthony -- Resources: -

Re: [web2py] Re: Cloning SQLlite into PostgreSQL

2015-04-08 Thread Johann Spies
On 2 April 2015 at 13:00, Gael Princivalle gaelprinciva...@gmail.com wrote: Hi Philip. Using UUIDs make the db slower right? Why? On huge databases the indexing will be slower but queries should not be slower than systems not using uuid.

[web2py] Re: Using ajax to call a function that uses LOAD, not working

2015-04-08 Thread 'sasogeek' via web2py-users
I was doing it the wrong way i think, but i did a workaround. I used the A helper to place a button on the page and when it's clicked it replaces itself with the form at statusform.load with ajax=True, and it works just fine On Tuesday, 7 April 2015 15:11:58 UTC+1, sasogeek wrote: default.py

Re: [web2py] Re: Cloning SQLlite into PostgreSQL

2015-04-08 Thread Johann Spies
For a new application it's not a problem, but someone have an experience about converting tables from standard ID to GUID? Firstly: backup :) I have done some conversions in the past. If I remember correctly, I added an extra column (say 'uuid'), filled it with unique values, created foreign

Re: [web2py] request table name

2015-04-08 Thread Anthony
I think the problem with the original code is that it adds the callback to the auth_event table itself, so when there is an insert on that table, it goes into infinite recursion. Instead, just skip that table when adding the callbacks:

Re: [web2py] request table name

2015-04-08 Thread Anthony
tested using before_delete callback is not work, because the main problem of webp2y imho is when using record_versioning or auth.signature, the record is not actually deleted, just set the field is_active into False / off, so the before_delete callback is not execute, the solution just

Re: [web2py] request table name

2015-04-08 Thread 黄祥
the problem is in the looping, but the partial from functools do the trick, thank you so much anthony. the solution is not use the looping, but put everything on it's own table definition, and if using in form level, just passed it using partial too. tested it work fine in form level (oncreate,

[web2py] Re: Last version of plugin_wiki?

2015-04-08 Thread Paolo Valleri
plugin_wiki is no longer supported. See http://www.web2py.com/books/default/chapter/29/03/overview?search=wiki#The-built-in-web2py-wiki Paolo On Tuesday, April 7, 2015 at 6:32:09 PM UTC+2, Najtsirk wrote: Hi guys, where can I get the latest version of plugin_wiki? Best, K --

[web2py] Re: web2py 2.10.3 si OUT

2015-04-08 Thread 黄祥
already discussed with anthony in another thread and created the issue https://github.com/web2py/web2py/issues/904 best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

Re: [web2py] Re: post does not appear in this forum, why ?

2015-04-08 Thread António Ramos
It does not make any sense to approve every post from a new user. Why dont you just approve the user ? Regards 2015-04-07 18:45 GMT+01:00 Dave S snidely@gmail.com: On Tuesday, April 7, 2015 at 6:45:44 AM UTC-7, Leonel Câmara wrote: Yes, this group is moderated so new members messages

Re: [web2py] request table name

2015-04-08 Thread 黄祥
already tried it but return an error e.g. define all tables on db_wizard_0.py *models/db_wizard_event.py* from functools import partial def after_insert_event(f, id, table): db.auth_event.insert(time_stamp = request.now, client_ip = request.client, user_id = auth.user_id,

Re: [web2py] Re: Triggering a one-time migration when schema changes

2015-04-08 Thread Michele Comitini
The following is a trick that gives little overhead and make migration happen when needed. python web2py.py -S your_app -M -R script.py -A --do-migrate script.py can be empty or do anything you like... then in db.py import sys if '--do-migrate' in sys.args: do_migrate = True else:

Re: [web2py] Re: Cloning SQLlite into PostgreSQL

2015-04-08 Thread Gael Princivalle
Thanks Johann, Philip, really useful. I'll use GUID. For a new application it's not a problem, but someone have an experience about converting tables from standard ID to GUID? Il giorno mercoledì 8 aprile 2015 11:22:22 UTC+2, Philip Kilner ha scritto: Hi Johann, Thanks for jumping in - had

Re: [web2py] Re: Cloning SQLlite into PostgreSQL

2015-04-08 Thread Philip Kilner
Hi Johann, Thanks for jumping in - had missed the message. On 08/04/15 10:10, Johann Spies wrote: On 2 April 2015 at 13:00, Gael Princivalle gaelprinciva...@gmail.com mailto:gaelprinciva...@gmail.com wrote: Using UUIDs make the db slower right? Why? On huge databases the indexing will be

Re: [web2py] Database

2015-04-08 Thread Richard Vézina
Reverse engineer is easy and commercial product have that... I don't know open source schema designer that is enough mature to butter with it... If you wrote your schema all by yourself you will have it in mind and you can refer rapidly to your models when you have a doubt or use Graphe model

Re: [web2py] Database

2015-04-08 Thread Richard Vézina
Write model and see the schema with web2py graph model that rely on pygraphviz... The rest is a waste of time!! :) On Wed, Apr 8, 2015 at 11:32 AM, Ron Chatterjee achatterjee...@gmail.com wrote: Because I ran across this link:

[web2py] Re: Please report here upgrading issues to web2py 2.10.2

2015-04-08 Thread Jim S
I put together a little test app, but can't reproduce the problem. However, it researching, I've tracked down the error to the following: Traceback 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. Traceback (most recent call last): File

Re: [web2py] Database

2015-04-08 Thread Ron Chatterjee
I agree with you. And I can understand why no one is interested in data base schema. That said, there are some advantage of using schema. Here is a quote: Ownership of schemas and schema-owned objects is transferable and Overall, maintenance of database become easier and I will recommend the

[web2py] Re: Please report here upgrading issues to web2py 2.10.2

2015-04-08 Thread Jim S
Using MySQL. I'll put something together to see if I can reproduce the issue. -Jim On Wednesday, April 8, 2015 at 8:24:02 AM UTC-5, Paolo Valleri wrote: Hi Jim, Which back-engine are you using? Have you tried with a different one? Can you pack a simple app that reproduce the issue? Paolo

Re: [web2py] Database

2015-04-08 Thread José Ricardo Borba
Ron, XML is a data interchange format (like JSON, ASCII,...), not suitable to storage data. To storage data, use a database (of your choice). Best regards, 2015-04-08 11:54 GMT-03:00 Kiran Subbaraman subbaraman.ki...@gmail.com: Won't a lxml based solution do? Am just trying to understand why

Re: [web2py] Database

2015-04-08 Thread Ron Chatterjee
Thank you for your feedback Richard. I will try the graphe model button and let you know. For the time being I start with sql designer despite its fault. On Wednesday, April 8, 2015 at 12:22:28 PM UTC-4, Richard wrote: Reverse engineer is easy and commercial product have that... I don't

Re: [web2py] request table name

2015-04-08 Thread 黄祥
just follow your hints, it works well n avoid me having an ugliness code (for put insert n update callback for every defined tables), but as describe later the before callback is still not work after following your hints. actually i kinda love the idea to set the is_active into False rather

Re: [web2py] Re: Cloning SQLlite into PostgreSQL

2015-04-08 Thread Ron Chatterjee
Thats one of the reason I like starting database using database schema. That way someone can use the XML and it works for any database domain. Just some thoughts:-) On Wednesday, April 8, 2015 at 7:52:37 AM UTC-4, Johann Spies wrote: For a new application it's not a problem, but someone have

[web2py] Re: How to implement Gmail Authentication

2015-04-08 Thread Willoughby
Web2PySlices has two examples of OAuth2 being used - have you looked at those? http://www.web2pyslices.com/slice/search?q=OAuth2 On Tuesday, April 7, 2015 at 10:01:22 AM UTC-4, Moiz Nagpurwala wrote: Hello, Still waiting for a working example of OAuth2 with Google. It is very crucial for

[web2py] Re: Last version of plugin_wiki?

2015-04-08 Thread Massimo Di Pierro
A Paolo says. This is no longer support because almost all of the functionality of the plugin (and more) and now in auth.wiki() and included in every web2py app. On Tuesday, 7 April 2015 11:32:09 UTC-5, Najtsirk wrote: Hi guys, where can I get the latest version of plugin_wiki? Best, K

Re: [web2py] Database

2015-04-08 Thread Ron Chatterjee
Speaking of database, if I have the xml file for the database, does anyone know how to use in web2py? fo I need yo use sqlachamy? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: auth_user table format

2015-04-08 Thread Massimo Di Pierro
can you please open a github ticket and reference this thread? On Monday, 6 April 2015 22:17:03 UTC-5, 黄祥 wrote: done. https://github.com/web2py/web2py/issues/904 attached that running fine (shown a format instead of an id) in prev version thanks and best regards, stifan --

[web2py] Double left join syntax

2015-04-08 Thread Lieven Van Acker
Hello all, I'm trying to perform a double left join, but can't seem to figure out the right syntax. Maybe someone could shed some light... This is what should be the resulting MySQL syntax: SELECT * FROM OnResource LEFT JOIN Contact Owner ON Owner.id = OnResource.Contact LEFT

[web2py] Re: Testing accions that access the database.

2015-04-08 Thread Vicente Carro
Thanks, this worked for me. In my case I wanted to do the tests in a clone of the original, so the data was there previously. Still I had problems with the migrations in web2py until I used this parameters: if request.function == '_TEST': workdb =

[web2py] Re: Accessing values in SQL form .

2015-04-08 Thread 黄祥
i think you can use validation on form level either u choose (FORM, SQLFORM, SQLFORM.grid or smartgrid or crud) ref: http://web2py.com/books/default/chapter/29/07/forms-and-validators best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] Accessing values in SQL form .

2015-04-08 Thread Hems Veeranki
I want to get all the values that are submitted by the user when he clicks submit button i want to process those value. For example there is database which stores books and number of copies available in a book-rental store. Then i want to use a form to take input from user so that he may ask

[web2py] doctesting xmlrpc call/service in web2py

2015-04-08 Thread Vicente Carro
Hi, I'm trying to doctest this tiny function: def call(): Function used for xmlrpc calls request.args.append(http: //mydomain/application/controller/call/xmlrpc) call() True session.forget() return service() But it fails before doing the comparison:

[web2py] Password recovery-restore through API

2015-04-08 Thread Jon M.
Greetings people! :D Is there some way to do password recovery, let's say, from curl for example? The main target is to get a SAFE WAY to restore password through API in order to use it, let's say, in some mobile application or somewhere that is not the web page... Is that possible? Have a

[web2py] Re: auth_user table format

2015-04-08 Thread 黄祥
done. https://github.com/web2py/web2py/issues/904 thanks and best regards, stifan On Wednesday, April 8, 2015 at 7:44:21 PM UTC+7, Massimo Di Pierro wrote: can you please open a github ticket and reference this thread? On Monday, 6 April 2015 22:17:03 UTC-5, 黄祥 wrote: done.

[web2py] Re: Please report here upgrading issues to web2py 2.10.2

2015-04-08 Thread Paolo Valleri
Hi Jim, Which back-engine are you using? Have you tried with a different one? Can you pack a simple app that reproduce the issue? Paolo On Tuesday, April 7, 2015 at 9:40:29 PM UTC+2, Jim S wrote: Just wondering if this is posted in the right place. Should I be reporting this issue

[web2py] Using Travis CI to test a web2py app on Github

2015-04-08 Thread Ian W. Scott
I've set up a travis-ci.org job to run my test suite (using pytest) whenever I push my app to its github repository. I'm running into the basic problem that pytest can't find the gluon libraries, since there's nothing in my repo above the level of my app directory. Does anyone know of a simple

Re: [web2py] request table name

2015-04-08 Thread Anthony
Don't check the Row object -- instead, directly inspect the update fields: if 'is_active' in f and f.is_active == False: [log delete event] else: [log update event] If you have some tables that aren't tracking revisions, then you will need a standard _after_delete callback for those.

Re: [web2py] Database

2015-04-08 Thread Kiran Subbaraman
Won't a lxml based solution do? Am just trying to understand why you want DAL support for XML based file-storage? Kiran Subbaraman http://subbaraman.wordpress.com/about/ On Wed, 08-04-2015 7:14 PM, Ron Chatterjee wrote: Speaking of database, if I have

Re: [web2py] Re: Triggering a one-time migration when schema changes

2015-04-08 Thread Niphlod
good too, but NEEDS to happen without lazy_tables ^_^ On Wednesday, April 8, 2015 at 9:42:25 AM UTC+2, mcm wrote: The following is a trick that gives little overhead and make migration happen when needed. python web2py.py -S your_app -M -R script.py -A --do-migrate script.py can be empty

[web2py] Re: web2py 2.10.3 si OUT

2015-04-08 Thread Dave S
On Thursday, April 2, 2015 at 3:19:49 PM UTC-7, Massimo Di Pierro wrote: I posted a new version to address some minor issues. If you upgrade from 2.9.11 or 2.9.12 the auto update may not work and you have to delete the file: web2py/gluon/dal FWIW, I downloaded the Windows version,

[web2py] Re: Using ajax to call a function that uses LOAD, not working

2015-04-08 Thread Dave S
On Wednesday, April 8, 2015 at 3:20:28 AM UTC-7, sasogeek wrote: I was doing it the wrong way i think, but i did a workaround. I used the A helper to place a button on the page and when it's clicked it replaces itself with the form at statusform.load with ajax=True, and it works just

Re: [web2py] Database

2015-04-08 Thread Ron Chatterjee
Because I ran across this link: http://www.vertabelo.com/blog/vertabelo-news/visual-design-of-sqlalchemy-models-in-6-steps So I was curious. If I use vertabelo or sqldesigner and save the database as an XML format, is there way to use sqlachemy to generate DAL syntax. I know I am making it

[web2py] Re: Using ajax to call a function that uses LOAD, not working

2015-04-08 Thread Derek
I don't have an answer, just a comment on the style... This is what you should not do - you're mixing the model, view, and controller into an inconceivable mess. On Tuesday, April 7, 2015 at 7:11:58 AM UTC-7, sasogeek wrote: default.py @auth.requires_login() def load_home(): loader =

Re: [web2py] Database

2015-04-08 Thread Dave S
On Wednesday, April 8, 2015 at 8:43:32 AM UTC-7, Richard wrote: Write model and see the schema with web2py graph model that rely on pygraphviz... The rest is a waste of time!! :) Punching the graph button says pygraphviz not found, which just means it isn't bundled with web2py or

Re: [web2py] Database

2015-04-08 Thread Richard Vézina
Maybe coming from this : https://bitbucket.org/al14s/rawr/issue/2/rhel-centos-fedora-pip-pygraphviz-does-not ?? Richard On Wed, Apr 8, 2015 at 4:25 PM, Dave S snidely@gmail.com wrote: On Wednesday, April 8, 2015 at 8:43:32 AM UTC-7, Richard wrote: Write model and see the schema with

Re: [web2py] Database

2015-04-08 Thread Ron Chatterjee
Yes. I had the same issue. I tried to install it and added the path of Graphviz2.38 to my windows path (using 8). So, I need to restart (to set the path). Thats why haven't tried again. But I got the same error. I am under the impression I need to install separately and add that to my local

[web2py] Re: Thread safety and importing db, response, session

2015-04-08 Thread Mark Graves
Another sanity check, sorry to revive a dead thread. I'm doing a whole lot of unit testing now, and factoring out a lot of code. I need to mock the db object, so I'm wondering: Is it thread safe to implement functions in modules that are imported and pass a db instance into them? ie: in a

[web2py] Re: Best way to display table columns in correct order using a Handsontable

2015-04-08 Thread Niphlod
todos.json() returns a list of dictionaries, each one being a row. in js terms, it's an array of objects. skimming through handsontable docs http://handsontable.com/demo/datasources.html, you can use an array of objects to populate the table, but if you want your own headers (and possibly in

[web2py] Best way to display table columns in correct order using a Handsontable

2015-04-08 Thread Tom Campbell
I have a query result named todos I am loading into a Handsontable in the view. The code below populates the Handsontable, but columns do not appear in the order they are defined in db.define_table(). In this case, while the database columns are 'id','title'.'description','priority', and

[web2py] auth.wiki()

2015-04-08 Thread Alex Glaros
just looked at auth.wiki(). Not sure if I understand well enough to ask these questions but: 1. Should a note in documentation state that migration must be set to True when auth.wiki function is first added to controller? 2. Can't get search to work 3. Seems that any logged on

[web2py] Re: Running register_onaccept code when registration is disabled

2015-04-08 Thread 黄祥
i think you can using database callback (after_insert) for it ref: http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#callbacks-on-record-insert--delete-and-update best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

Re: [web2py] Database

2015-04-08 Thread Dave S
On Wednesday, April 8, 2015 at 2:09:02 PM UTC-7, Ron Chatterjee wrote: Yes. I had the same issue. I am under the impression I need to: (1) install pygraphviz separately and add that to my local python (canopy/anaconda) compiler/interpreter (2) install Graphviz2.38 and add the path to my

Re: [web2py] Re: web2py Complete Reference Manual

2015-04-08 Thread Carlos Zenteno
@Ron: There is a video somewhere, where Anthony talks about the inner works of web2py. Let me see if I can find it, unless someone nice, beats me to post it... -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

Re: [web2py] request table name

2015-04-08 Thread 黄祥
the delete call back execute on after update callback can't passed the set object to get an id deleted. e.g. def after_update_event(s, f, table): table_input = s.select().first() if 'is_active' in f and f['is_active'] == False: current.db.auth_event.insert(time_stamp = current.request.now,

Re: [web2py] Database

2015-04-08 Thread Dave S
On Wednesday, April 8, 2015 at 1:43:57 PM UTC-7, Richard wrote: Maybe coming from this : https://bitbucket.org/al14s/rawr/issue/2/rhel-centos-fedora-pip-pygraphviz-does-not ?? h /dps Richard On Wed, Apr 8, 2015 at 4:25 PM, Dave S snide...@gmail.com javascript: wrote: On

[web2py] Re: web2py 2.10.3 si OUT

2015-04-08 Thread 黄祥
functional test is not work in newest version, in old version work. *error* C:\web2py\applications\test\modulespython funcional_test.py No handlers could be found for logger web2py Changed session ID test Traceback (most recent call last): File funcional_test.py, line 32, in module

Re: [web2py] request table name

2015-04-08 Thread Anthony
Actually, it turns out you need to use the _before_delete callback -- it should be executed, even when using record versioning. Anthony On Wednesday, April 8, 2015 at 5:14:00 PM UTC-4, 黄祥 wrote: the delete call back execute on after update callback can't passed the set object to get an id

[web2py] Running register_onaccept code when registration is disabled

2015-04-08 Thread Jordan Ladora
Following the example in the book, I use in db.py- def give_create_permission(form): group_id = auth.id_group('user_%s' auth.user_id) auth.add_permission(group_id, 'read', db.comment) auth.settings.register_onaccept = give_create_permission ...but what to do when you also have-

[web2py] Re: IMPORTANT - WEB2PY CONSULTING

2015-04-08 Thread Remco Boerma
Please add http://www.dutveul.nl (Netherlands) to the list. The site itself is web2py and a few solutions i'm working on now are web2py based solutions. Only recently i started my ICT job as self-employed part-time. Will add a web2py specific page in the near future. Regards, Remco --

[web2py] Re: web2py 2.10.3 si OUT

2015-04-08 Thread 黄祥
on windows 7 x64 Version 2.10.3-stable+timestamp.2015.04.02.21.42.07 (Running on Rocket 1.2.6, Python 2.7.8) Traceback (most recent call last): File C:\web2py\gluon\admin.py, line 178, in app_create w2p_unpack('welcome.w2p', path) File C:\web2py\gluon\fileutils.py, line 280, in