[web2py] Re: Ractive and Single Page Apps

2015-10-20 Thread Niphlod
if all you want is not reloading the entire page (before going to "full logic pushed on the client, server just sends the data over") pjax takes maybe 4 lines of code. On Wednesday, October 21, 2015 at 8:14:37 AM UTC+2, p a wrote: > > El miércoles, 21 de octubre de 2015, 3:39:34 (UTC+2), Rod Wat

[web2py] Re: OS X Permissions question: echo works in ../web2py but not ../web2py/applications?

2015-10-20 Thread Ron McOuat
OS X El Capitan or 10.11.X no longer has a Repair Permissions option in Disk Utility. Apple says they protect the system files and it is no lobger needed. On Tuesday, 20 October 2015 09:07:00 UTC-7, Massimo Di Pierro wrote: > > I do not know but you do seem to have permissions to write in that f

[web2py] Re: Ractive and Single Page Apps

2015-10-20 Thread p a
El miércoles, 21 de octubre de 2015, 3:39:34 (UTC+2), Rod Watkins escribió: > > So let me ask, was the conversion to a client side SPA worth it? Also, can > I use just ractive and let web2py do the routing and some of the templating > (I guess that sort of how Massimo did it in the estore project

[web2py] Re: Storing the Original Filename in the official web2py book

2015-10-20 Thread 黄祥
i think it's dillema in here if request.vars.image != None: # this work when the image is there, can't work if the image is empty (leave blank), it return an error traceback said : AttributeError: 'str' object has no attribute 'filename' if request.vars.image: # this work when the image is blank

[web2py] Re: Ractive and Single Page Apps

2015-10-20 Thread Rod Watkins
Hi p a, What you have described is basically where I am at. I have a large multi-page app. My plan is to start as you did and "component-ize" it and convert the bulk of the views to components I can then load with ajax. To convert it to a full-fledged SPA, I'd then start using ractive to move t

[web2py] Re: how to test if a controller function exists

2015-10-20 Thread Dave S
On Tuesday, October 20, 2015 at 4:25:00 PM UTC-7, Anthony wrote: > > Determining at runtime that a particular function exists seems expensive >> if you have control over the source file that defines the target and the >> function that needs to know. >> > > I don't see why it would be particular

[web2py] Re: how to test if a controller function exists

2015-10-20 Thread Anthony
> > Determining at runtime that a particular function exists seems expensive > if you have control over the source file that defines the target and the > function that needs to know. > I don't see why it would be particularly expensive -- just a dictionary lookup. We already have code like "if

[web2py] Re: how to test if a controller function exists

2015-10-20 Thread Dave S
On Tuesday, October 20, 2015 at 3:31:43 PM UTC-7, Anthony wrote: > > On Tuesday, October 20, 2015 at 4:45:10 PM UTC-4, Dave S wrote: >> >> >> >> On Tuesday, October 20, 2015 at 1:24:50 PM UTC-7, Anthony wrote: >>> >>> Not sure I follow. >> >> >> If the 2 functions are in the same [controller] .py

[web2py] Re: Running function after an auth db modification

2015-10-20 Thread Dave S
On Tuesday, October 20, 2015 at 10:51:28 AM UTC-7, Gael Princivalle wrote: > > Thanks Anthony but what does it mean the proper signature? > I think in this case, he's referring to Python ... the def line of the function specifies its parameters (or arguments, if you prefer). Code that calls t

[web2py] Re: how to test if a controller function exists

2015-10-20 Thread Anthony
On Tuesday, October 20, 2015 at 4:45:10 PM UTC-4, Dave S wrote: > > > > On Tuesday, October 20, 2015 at 1:24:50 PM UTC-7, Anthony wrote: >> >> Not sure I follow. > > > If the 2 functions are in the same [controller] .py, then it is often just > a matter of source control to ensure that they both e

Re: [web2py] The shell on web2py does not execute any instruction

2015-10-20 Thread Massimo Di Pierro
yes. the web shell sucks. The problem is that it cannot reliably remember the state across http requests. It really is only to explore the API. The python web2py shell on the other side... On Tuesday, 20 October 2015 16:09:01 UTC-5, p a wrote: > > El martes, 20 de octubre de 2015, 18:06:36 (UTC+

[web2py] Re: Ractive and Single Page Apps

2015-10-20 Thread p a
A few months ago I decided to turn my existing, rather big and complex multi-page web2py app into a single page app. The plan is to load all the existing pages using web2py_component into the div#main_region, so that I get a working application as soon as possible, but then start to move view l

[web2py] Re: upload field type doesn't show in grid or smartgrid

2015-10-20 Thread 黄祥
yes, you are right, my bad, there is readable = False, set for the upload field type in the middle of somewhere (i couldn't found in the first place, but now target spoted and silenced :) ). best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http:

Re: [web2py] The shell on web2py does not execute any instruction

2015-10-20 Thread p a
El martes, 20 de octubre de 2015, 18:06:36 (UTC+2), Ramos escribió: > > shell sucks :P > But the python shell rocks! python2 web2py.py -S your_app -M -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google

[web2py] Re: Running function after an auth db modification

2015-10-20 Thread 黄祥
perhaps an example can make it clear e.g. def __after_insert_auth_user(f, id): db.profile.insert(username = f.username, first_name = f.first_name, last_name = f.last_name, email = f.email) def __after_update_auth_user(s, f): auth_user = s.select().first() db(db.profile.auth_user == auth_user.id).

[web2py] Re: Replace 'Log in' text in auth.navbar by 'User'

2015-10-20 Thread Alex Glaros
for what it's worth, my users also find it a little confusing, so there might be some value for web2py to change it. but this is an extremely unimportant and minor enhancement Alex Glaros -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2

[web2py] Re: how to test if a controller function exists

2015-10-20 Thread Dave S
On Tuesday, October 20, 2015 at 1:24:50 PM UTC-7, Anthony wrote: > > Not sure I follow. If the 2 functions are in the same [controller] .py, then it is often just a matter of source control to ensure that they both exist at the same time. Introspection has its value, but also its costs. /dp

[web2py] Re: how to test if a controller function exists

2015-10-20 Thread Anthony
Not sure I follow. -- 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-user

[web2py] Re: how to test if a controller function exists

2015-10-20 Thread Dave S
On Tuesday, October 20, 2015 at 11:35:26 AM UTC-7, Anthony wrote: > > On Tuesday, October 20, 2015 at 2:19:39 PM UTC-4, Dave S wrote: >> >> >> >> On Tuesday, October 20, 2015 at 6:21:08 AM UTC-7, A3 wrote: >>> >>> Thanks for the detailed explanation. >>> >> >> And, just to play Captain Obvious,

[web2py] Re: how to test if a controller function exists

2015-10-20 Thread Anthony
On Tuesday, October 20, 2015 at 2:19:39 PM UTC-4, Dave S wrote: > > > > On Tuesday, October 20, 2015 at 6:21:08 AM UTC-7, A3 wrote: >> >> Thanks for the detailed explanation. >> > > And, just to play Captain Obvious, you probably don't need that much > effort if both your functions are in the sam

[web2py] Re: How to update db record using ajax?

2015-10-20 Thread Leonel Câmara
I usually have a controller like this: def update_or_insert_thing(): response.view ='generic.json' ret = None if request.vars: if request.vars.id: request.vars.id = int(request.vars.id) ret = db(db.thing.id == request.vars.id)

[web2py] file upload "not authorized"

2015-10-20 Thread Jason Solack
Hello all, I have been trying to enable file uploading using the examples in the documentation and then using the follow approach: https://groups.google.com/forum/?fromgroups#!searchin/web2py/file$20upload/web2py/10FXxJrVR5k/6ySXshodipMJ but each time i do it i get "not authorized" response.fl

Re: [web2py] Re: OS X Permissions question: echo works in ../web2py but not ../web2py/applications?

2015-10-20 Thread Tom Campbell
Ah, relief. You have diagnosed the issue exactly. Thank you so much. -- 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 yo

[web2py] Re: how to test if a controller function exists

2015-10-20 Thread Dave S
On Tuesday, October 20, 2015 at 6:21:08 AM UTC-7, A3 wrote: > > Thanks for the detailed explanation. > And, just to play Captain Obvious, you probably don't need that much effort if both your functions are in the same .py file. /dps > > Op dinsdag 20 oktober 2015 03:11:53 UTC+2 schreef An

[web2py] Re: Replace 'Log in' text in auth.navbar by 'User'

2015-10-20 Thread Leonel Câmara
You have to either use server side DOM manipulation or use navbar mode="bare" and make your own custom navbar. -- 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)

[web2py] Re: Running function after an auth db modification

2015-10-20 Thread Gael Princivalle
Thanks Anthony but what does it mean the proper signature? def add_phplist_user(f,id): auth_user = db.auth_user(id) #add user db_phplist.phplist_user_user.insert( email = auth_user.email, confirmed = auth_user.newsletter) db.auth_user._after_insert.append(lambda f,id:

Re: [web2py] Re: OS X Permissions question: echo works in ../web2py but not ../web2py/applications?

2015-10-20 Thread Massimo Di Pierro
It depends now you run the web server. On Mac you probably run it with rocket under your credentials. So if they are owned by you and you have permission to write in the folder, it should work. I have had issues with borken permissions on Mac and the solution was to delete the folder and create

[web2py] web2py file upload returning "not authorized"

2015-10-20 Thread Jason Solack
Hello all, I'm trying to upload files in my web app using the code from the manual and using the technique described here: https://groups.google.com/forum/#!searchin/web2py/upload$20file/web2py/10FXxJrVR5k/6ySXshodipMJ when i try to upload a file i'm getting a flash response of "not authorized"

Re: [web2py] Re: OS X Permissions question: echo works in ../web2py but not ../web2py/applications?

2015-10-20 Thread Tom Campbell
Thank you, Dr. Di Pierro! I did reboot, then run Disk Utility, which is now so user friendly I couldn't see what it found. Didn't solve the problem. I will indeed use chown. Just wanted to make sure there was no change of permissions in web2py that I needed to know about. Thought maybe there was s

[web2py] Re: Running function after an auth db modification

2015-10-20 Thread Anthony
Note, if you function already has the proper signature, there is no reason to wrap it in a lambda. Also, your callbacks do not have to return an empty dictionary (they are not controller actions). Anthony On Tuesday, October 20, 2015 at 9:19:20 AM UTC-4, Gael Princivalle wrote: > > Thanks Niphl

Re: [web2py] Re: Can web2py "front-end" an API?

2015-10-20 Thread Anthony
I think it's clear that by "model-less," Luis meant no db/database model definitions (at least not with regard to third party API's). In the past, the term "model-less" has also been used to describe an architecture that avoids use of files in the /models folder. The term is ambiguous because a

Re: [web2py] Re: Can web2py "front-end" an API?

2015-10-20 Thread Richard Vézina
Hmm... Model-Less application shouldn't be regarded as a web2py application without model properly defined... Model-Less web2py application is just an application written with web2py where the models are not defined in the models/ folder of web2py to avoid cost of parsing models definition at each

Re: [web2py] The shell on web2py does not execute any instruction

2015-10-20 Thread António Ramos
shell sucks :P 2015-10-20 15:59 GMT+01:00 Vladimir Torres : > Good Morning users about web2py > > I am learning about web2py, I must to connect to Oracle data base, I want > to test the conecction DAL from shell but it only shows "none", any > instruction executed shows "none", > someone knows wh

[web2py] Re: upload field type doesn't show in grid or smartgrid

2015-10-20 Thread Massimo Di Pierro
Should work. Can you provide an example of code to reproduce? On Monday, 19 October 2015 23:20:05 UTC-5, 黄祥 wrote: > > hi, > > i have upload field type doesn't show in grid or smartgrid, in the older > version i believe it shown by default. is it normal in the recent version > (2.12.3) not shown

[web2py] Re: OS X Permissions question: echo works in ../web2py but not ../web2py/applications?

2015-10-20 Thread Massimo Di Pierro
I do not know but you do seem to have permissions to write in that folder. You can use chmod and chown to restore those permissions. This could also be a problem with the filesystem. Some time permissions go bad in OSX and you have to use the Disk Utils to fix permissions and then reboot. On Mo

[web2py] The shell on web2py does not execute any instruction

2015-10-20 Thread Vladimir Torres
Good Morning users about web2py I am learning about web2py, I must to connect to Oracle data base, I want to test the conecction DAL from shell but it only shows "none", any instruction executed shows "none", someone knows why happen this?. Thanks. -- Resources: - http://web2py.com - http://

[web2py] How to update db record using ajax?

2015-10-20 Thread Edward Shave
For some reason I just can't seem to get my head round the ajax documentation. I have what I think is a simple goal. Using javascript / jQuery, how do I silently update db.person with the following data? {"id":3, "firstName":"John", "lastName":"Doe"} I appreciate I need to supply a function to

[web2py] web2py edit modify field sqlform.grid

2015-10-20 Thread Laurent Lc
Hi, i'd like a very simple example please (i begin) : could you tell me how to do for updating a field when i use sqlform.grid. Example: my db : db.define_table('message', Field('firstname',requires=IS_NOT_EMPTY()), Field('lastname',requires=IS_NOT_EMPTY()), Field('team',requires=IS_NOT_

[web2py] Fwd: aiosmtpd 1.0a1 - asyncio-based implementations of SMTP/LMTP

2015-10-20 Thread Massimo DiPierro
This is nice if you want a pure python SMTP server Begin forwarded message: > From: Barry Warsaw > Subject: aiosmtpd 1.0a1 - asyncio-based implementations of SMTP/LMTP > Date: October 20, 2015 at 8:51:29 AM CDT > To: > Reply-To: python-l...@python.org > > I'm very happy to announce the first a

[web2py] Re: how to test if a controller function exists

2015-10-20 Thread A3
Thanks for the detailed explanation. Op dinsdag 20 oktober 2015 03:11:53 UTC+2 schreef Anthony: > > If you have the function name, you can do: > > if function_name in globals(): > > And if you have the actual function object, you can do: > > if function.__name__ in globals(): > > Note, th

[web2py] Re: Running function after an auth db modification

2015-10-20 Thread Gael Princivalle
Thanks Niphlod. After insert works great: def add_phplist_user(f,id): auth_user = db.auth_user(id) #add user db_phplist.phplist_user_user.insert( email = auth_user.email, confirmed = auth_user.newsletter) return dict() db.auth_user._after_insert.append(lambda f,id:

[web2py] Setting up database table with date.

2015-10-20 Thread Garry Smith
Hi I have the following defining my DB tables:- db.define_table('school_students', Field('first_name', 'string',requires=IS_NOT_EMPTY()), Field('surname', 'string',requires=IS_NOT_EMPTY()), Field('year', 'string',requires=IS_NOT_EMPTY()), Field('form', 'string',requires=IS_NOT_EMP

[web2py] Re: Can web2py "front-end" an API?

2015-10-20 Thread Luis Valladares
What if you use a model-less aplication? thats the way we handled this, we have a web2py application that consumes a lot of microservices, this application doesnt have any DB object and doesnt use the dal, it makes HTTP request to the api inside the controllers (Using the python requests librar

Re: [web2py] Re: Replace 'Log in' text in auth.navbar by 'User'

2015-10-20 Thread Massimiliano
Take a look to gluon/tools.py in Auth.navbar.bare maybe is what you need. On Tue, Oct 20, 2015 at 11:10 AM, Gael Princivalle < gaelprinciva...@gmail.com> wrote: > Someone knows how I can do it? > > > Il giorno martedì 13 ottobre 2015 16:27:41 UTC+2, Gael Princivalle ha > scritto: >> >> Hello a

[web2py] Re: Running function after an auth db modification

2015-10-20 Thread Niphlod
see the manual about database callbacks. http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#callbacks-on-record-insert--delete-and-update On Tuesday, October 20, 2015 at 11:49:02 AM UTC+2, Gael Princivalle wrote: > > Hello all. > > I would like to run a function everytim

[web2py] Running function after an auth db modification

2015-10-20 Thread Gael Princivalle
Hello all. I would like to run a function everytime there is a modification in auth. something like: auth.settings.onchange = lambda: myfunction() Or only if a specific field change: auth.settings.myfield.onchange = lambda: myfunction() Is it possible? I need it for changing a field value in a

[web2py] Re: Sitemap Question

2015-10-20 Thread Gael Princivalle
Hello Joe. I use the Scheduler for that, for making every day a new updated sitemap. I use txt sitemaps because I've saw that if an XML sitemap is too long Google don't take care of it. In txt yes. Here is an example: def sitemap_txt_auto(): import os from gluon.myregex import regex_exp

[web2py] Re: Replace 'Log in' text in auth.navbar by 'User'

2015-10-20 Thread Gael Princivalle
Someone knows how I can do it? Il giorno martedì 13 ottobre 2015 16:27:41 UTC+2, Gael Princivalle ha scritto: > > Hello all. > > It seems that some users the first time they want to login expect that > it's just necessary click on the first level menu 'Log in'. > But it's not like that, they hav

[web2py] Re: Insert/update user record in 2 db

2015-10-20 Thread Gael Princivalle
Ok thank's. Il giorno martedì 13 ottobre 2015 21:18:33 UTC+2, Niphlod ha scritto: > > a legacy db just needs migrate=False. Nothing else. Just as a production > db where migrations aren't needed in THAT single request. > > tl;dr: The default for every NON "development-mylaptop-etc" environment