[web2py] Re: What a good web2py application architecture looks like?

2016-11-21 Thread mfarees . knysys
I'll definitely keep these tips in mind. Thank you ppl.

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: web2py react-python

2016-11-21 Thread Mark Graves
One other thing that popped into my head after reading Anthony's points
about search engine indexing would be permanent URI views (theoretically),
whereas with pure JS apps often my experience has been less than thrilling
with the routing capacities.

On Mon, Nov 21, 2016 at 3:41 PM, Anthony  wrote:

> On Monday, November 21, 2016 at 4:44:07 AM UTC-5, Leonel Câmara wrote:
>>
>> José a use case may be for graceful degradation when clients don't have
>> javascript.
>>
>
> The other typical use cases for server-side rendering are (a) support
> search engine indexing, and (b) faster rendering of the initial UI in the
> browser (the idea being that you send the HTML of the initial view to the
> browser, and then let the browser take over rendering from that point).
>
> Anthony
>
> --
> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/web2py/GwaHrT4Dqxg/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: web2py react-python

2016-11-21 Thread Anthony
On Monday, November 21, 2016 at 4:44:07 AM UTC-5, Leonel Câmara wrote:
>
> José a use case may be for graceful degradation when clients don't have 
> javascript.
>

The other typical use cases for server-side rendering are (a) support 
search engine indexing, and (b) faster rendering of the initial UI in the 
browser (the idea being that you send the HTML of the initial view to the 
browser, and then let the browser take over rendering from that point).

Anthony 

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: 50x performance improvement for web2py in TechEmpower Web Framework Benchmarks

2016-11-21 Thread Anthony
On Monday, November 21, 2016 at 2:39:21 AM UTC-5, Mark Graves wrote:
>
> This is great news! Thank you for working on this, all of you.
>
> Any ability to check out the errors?
>

Not that I know of. Note, the errors occurred only on the 20-update 
requests when running on physical hardware (I know, technically everything 
is ultimately running on "physical hardware"). They also ran tests in the 
cloud (on Azure), and there web2py was very competitive, even with the 
20-update requests. See:

https://www.techempower.com/benchmarks/#section=data-r13=cl=update=4ftgjj=35s-0=4=6=0-jz6rk-4fti4g-0-9zldvk-1ekg-2

In general, I think web2py's *relative *performance was slightly better on 
Azure vs. the physical hardware tests.

Anthony

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: web2py react-python

2016-11-21 Thread José Luis Redrejo
Yes, thanks for the use case. I had not thought of that possibility.
Nowadays it's weird to think of someone using a non-javascript ready
browser.
José L.

2016-11-21 12:59 GMT+01:00 Mark Graves :

> Way better use case Leonel, thanks =)
>
> On Mon, Nov 21, 2016 at 3:44 AM, Leonel Câmara 
> wrote:
>
>> José a use case may be for graceful degradation when clients don't have
>> javascript.
>>
>> --
>> 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 a topic in the
>> Google Groups "web2py-users" group.
>> To unsubscribe from this topic, visit https://groups.google.com/d/to
>> pic/web2py/GwaHrT4Dqxg/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> web2py+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> 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-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Need help with VideoTest!!

2016-11-21 Thread 黄祥
perhaps you can use python subprocess, but it's not thread safe
*e.g.*
*static/scripts/test.sh*
#!/bin/sh
nohup python web2py.py -S VideoTest -M -R 
applications/VideoTest/modules/video_to_flv.py

*controllers/default.py*
import subprocess
def test():
command = "applications/VideoTest/static/scripts/test.sh"
process = subprocess.Popen(command, stdout = subprocess.PIPE, stderr = 
subprocess.PIPE)
output, err = process.communicate()

best regards,
stifan

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: does field object know it's tablename?

2016-11-21 Thread Limedrop
Yes, it does.  You can access the tablename like this:

>>>db.auth_user.email._tablename
'auth_user'


On Monday, 21 November 2016 23:14:00 UTC+13, Jurgis Pralgauskis wrote:
>
> or should I pass tablename to function alongside?
>

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] db showing none

2016-11-21 Thread 黄祥
pls try
python /web2py_path/web2py.py --nogui --no-banner -S appname -M

best regards,
stifan

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: info: w3 css, responsive

2016-11-21 Thread Mirek Zvolský
Great.
What about layout.html ? I just try to remove bootstrap dependencies...
Or grid?




On Monday, 21 November 2016 16:19:21 UTC+1, eric cuver wrote:
>
> I use w3 css it works well with web2py and cordova for mobile
>
> eg: for custum login
>
> {{=form.custom.begin}}
> 
> Email
> {{form.custom.widget.email['_class']='w3-input w3-tangerine w3-large'}}
> {{=form.custom.widget.email}}
> 
> Mots de passe
> {{form.custom.widget.password['_class']='w3-input w3-tangerine '}}
> 
> {{=form.custom.widget.password}}
> {{form.custom.widget.remember_me['_checked']= 'true'}}
> 
>   {{=form.custom.widget.remember_me}}
> {{form.custom.submit['_class']= 'w3-btn w3-center w3-btn w3-xlarge 
> w3-blue'}}
> {{form.custom.submit['_id']= 'valide'}}
> {{form.custom.submit['_value']= 'validez'}}
> 
> {{=form.custom.submit}}
> 
> {{=form.custom.end}}
>
>
> Le lundi 21 novembre 2016 13:17:41 UTC+1, Mirek Zvolský a écrit :
>>
>> not web2py, but looks interesting.
>>
>> http://www.w3schools.com/w3css/default.asp
>>
>> On mobile pages load instantly. In oposite to bootstrap3.
>>
>> Does somebody use it ?
>>
>>
>>

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] db showing none

2016-11-21 Thread Kiran Subbaraman
Are you starting the shell with the `-S application-name` option? Take a 
look at the command line options for web2py: 
http://web2py.com/books/default/chapter/29/04/the-core#Command-line-options



Kiran Subbaraman
http://subbaraman.wordpress.com/about/

On Fri, 18-11-2016 12:35 AM, Divyanshu Srivastava wrote:


Hi !
I'm just getting started with web2py

in db.py
db = DAL(myconf.get('db.uri'),
 pool_size=myconf.get('db.pool_size'),
 migrate_enabled=myconf.get('db.migrate'),
 check_reserved=['all'])
and in shell

db  is showing none

i've tried 
DAL('sqlite://storage.sqlite',pool_size=1,check_reserved=['all'])


Pls help!
--
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to web2py+unsubscr...@googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.


--
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-users" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Custom html email on auth.settings.registration_requires_verification = True

2016-11-21 Thread António Ramos
oops... :)

rewinding my head again to the top of the thread.

Thank you Leonel...

2016-11-21 17:07 GMT+00:00 Leonel Câmara :

> Ramos you need to escape the % in 100%
>
> This should work
>
> b="\r\n\r\n  \r\n
>  \r\n  \r\n
> *%(a)s*\r\n\r\n\r\n\r\n >\r\n\r\n\r\n"
>
> b % dict(a=1)
>
> --
> 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-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Custom html email on auth.settings.registration_requires_verification = True

2016-11-21 Thread Leonel Câmara
Ramos you need to escape the % in 100%

This should work

b="\r\n\r\n  \r\n\r\n  \r\n  *%(a)s*\r\n 
  
 \r\n\r\n\r\n\r\n\r\n\r\n"

b % dict(a=1)

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Custom html email on auth.settings.registration_requires_verification = True

2016-11-21 Thread António Ramos
simpler example
i cannot interpolate this string

b="\r\n\r\n  \r\n\r\n  \r\n  *%(a)s*\r\n

 \r\n\r\n\r\n\r\n\r\n\r\n"
like this

b % dict(a=1)

ValueError: unsupported format character *' ' '* (0x27) at index 103

2016-11-21 16:22 GMT+00:00 António Ramos :

> my template "see attached file"
>
> in the console:
> response.render('templates/email_verification.html',dict(key="teststr"))
> works ok
> but
> response.render('templates/email_verification.html') % dict(key="teststr")
> does not work
> i get
> unsupported format character '!' (0x21) at index 615
>
> this is the same behaviour as
> email_body = messages.verify_email % d
> so i cannot pass parameters inside the render function
> verify email will interpolate it with a dict
>
> i already have other html emails working but the *verify_email* one is
> doomed...
>
> any ideas?
> regards
> António
>
> 2016-11-21 13:21 GMT+00:00 Leonel Câmara :
>
>> username is passed by auth, and it's not necessarily the "username" field
>> it can be the email if you're not using an username.
>>
>> Basically after register if you have registration_requires_verification
>> auth send an email where the body is defined as
>>
>> d = dict(form.vars) # form.vars holds the registration form values
>> d.update(dict(key=key, link=link, username=form.vars[username])) #
>> exactly what username is, is defined earlier according to your settings
>> email_body = messages.verify_email % d
>>
>>
>> You can actually build verify_email using html helpers if you aren't
>> being able to do it with response.render
>>
>> auth.messages.verify_email = HTML(
>> HEAD(),
>> BODY(
>> H1(T('Welcome to MY AMAZING WEBSITE'
>> )),
>> P(T('Click on the link below to
>> check your e-mail'), ':'),
>> A(URL(r=request,c='default',f='user',
>> args=['verify_email'], scheme=True, host=True) + '/%(key)s ', _href=URL(r
>> =request,c='default',f='user',args=['verify_email'], scheme=True, host=
>> True) + '/%(key)s '),
>> P(T('Thank You')),
>> P(T('From MY AMAZING WEBSITE')),
>> )
>>  ).xml()
>>
>> Another alternative is to just use a string with HTML in there.
>>
>> --
>> 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-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to web2py+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Versioning Erro

2016-11-21 Thread Leonel Câmara
It is a bug, see:
https://github.com/web2py/web2py/issues/1245

web2py needs to either remove the mercurial integration or keep up with 
their api modifications.

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Error when trying to submit or edit new data using sqlform.grid

2016-11-21 Thread Jim S
You need to initialize the form variable in the so when request.vars is 
null you have something pass to return.

See - form = None in the code below.

-Jim

On Monday, November 21, 2016 at 9:42:54 AM UTC-6, Hugo wrote:
>
>
> Hello,
>
> I am facing an error when using web2py sqlform.grid that I am not 
> understanding why.
>
> I have the controller where I define the form:
>
> def search_records():
>
>   form = None 

> if request.vars:
> selectable = request.vars.z
> DBconn = db._uri
>
> name = searchtable(selectable)
>
> try:
> form = SQLFORM.grid(query=name, orderby=None, searchable=True, 
> sortable=True, paginate=20, deletable=True,
> editable=True, details=True, selectable=None, 
> user_signature=False, create=True, csv=False,
> links=None, links_in_grid=True, 
> maxtextlength=100, sorter_icons=('[^]', '[v]'),
> ui='jquery-ui', showbuttontext=True, 
> _class="web2py_grid", formname='web2py_grid',
> search_widget='default', ignore_rw=True)
>
> response.view = 'default/search_records.html'
>
> except:
> redirect(URL('default', 'index'))
>
>
> return dict(form=form, selectable=selectable)
>
>
> the function searchtable returns the table to present in the grid, so the 
> variable name is spmething like: db.TABLE_TO_PRESENT
>
> The view page returns what is expected with the respective links "add 
> record", "view", "edit" and "delete. The error comes when I use the link 
> "add record" or "edit". After opining the correct page to insert the data, 
> when clicking submit it shows the error:
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
> 10.
>
> Traceback (most recent call last):
>   File "...\web2py\gluon\restricted.py", line 227, in restricted
> exec ccode in environment
>   File ".../applications/Mappings/controllers/search_records.py" 
> ,
>  line 44, in 
>   File "...\web2py\gluon\globals.py", line 417, in 
> self._caller = lambda f: f()
>   File ".../web2py/applications/Mappings/controllers/search_records.py" 
> ,
>  line 36, in search_records
> return dict(form=form, selectable=selectable)
> UnboundLocalError: local variable 'form' referenced before assignment
>
>
> So it seems that it loses the information relative to that form that was 
> previously loaded.
>
> I am trying to understand the reason for this but I can't get to any 
> conclusion. Can anyone help me?
>
> Thank you.
>
>
>
>

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Create form for table

2016-11-21 Thread Jim S
To get started quickly I'd read through the book.  Specifically:

http://web2py.com/books/default/chapter/29/07/forms-and-validators#SQLFORM-grid

-Jim

On Monday, November 21, 2016 at 9:42:54 AM UTC-6, Eduardo A. Saad wrote:
>
> Hello All,
>
> I'm new to web2py. I'm on mac os x.
>
> I managed to:
> 1. Install web2py.
> 2. Run it.
> 3. Create new application, similar to welcome.
> 4. Create table. (It started working when I added config related code).
>
> I want to create a form to view - add - update - delete data from my table.
> How do I do this?
>
> Thanks! Bests. E
>
>

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: web2py remote access

2016-11-21 Thread Jim S
What installation method did you use?  How are you starting web2py?  Is it 
running on port 80?

-Jim

On Monday, November 21, 2016 at 9:42:54 AM UTC-6, Mark C wrote:
>
> Hello.  I've installed web2py on rhel 6 and have successfully connected to 
> the admin interface (ssh tunneling), but was interested in calling 
> controllers over port 80 from remote machines.  Just testing around now, so 
> ssl is not required.  Many thanks for any thoughts.
>
> I'm on the 2nd web2py video (hello world) by Di Pierro, so sorry if I'm 
> on the verge of this information from the vid :)
>

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Custom html email on auth.settings.registration_requires_verification = True

2016-11-21 Thread António Ramos
my template "see attached file"

in the console:
response.render('templates/email_verification.html',dict(key="teststr"))
works ok
but
response.render('templates/email_verification.html') % dict(key="teststr")
does not work
i get
unsupported format character '!' (0x21) at index 615

this is the same behaviour as
email_body = messages.verify_email % d
so i cannot pass parameters inside the render function
verify email will interpolate it with a dict

i already have other html emails working but the *verify_email* one is
doomed...

any ideas?
regards
António

2016-11-21 13:21 GMT+00:00 Leonel Câmara :

> username is passed by auth, and it's not necessarily the "username" field
> it can be the email if you're not using an username.
>
> Basically after register if you have registration_requires_verification
> auth send an email where the body is defined as
>
> d = dict(form.vars) # form.vars holds the registration form values
> d.update(dict(key=key, link=link, username=form.vars[username])) #
> exactly what username is, is defined earlier according to your settings
> email_body = messages.verify_email % d
>
>
> You can actually build verify_email using html helpers if you aren't being
> able to do it with response.render
>
> auth.messages.verify_email = HTML(
> HEAD(),
> BODY(
> H1(T('Welcome to MY AMAZING WEBSITE'
> )),
> P(T('Click on the link below to check
> your e-mail'), ':'),
> A(URL(r=request,c='default',f='user',
> args=['verify_email'], scheme=True, host=True) + '/%(key)s ', _href=URL(r=
> request,c='default',f='user',args=['verify_email'], scheme=True, host=True
> ) + '/%(key)s '),
> P(T('Thank You')),
> P(T('From MY AMAZING WEBSITE')),
> )
>  ).xml()
>
> Another alternative is to just use a string with HTML in there.
>
> --
> 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-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Title: Template Base


  
  
  
  

  

  



  

  

  

  


  

  
  	FileIt: Account validation
  

  


  

  

  

  
















  

  
  

  



  

  
  	You are almost there...
  

  


  

  
  	Security is important for us, so this is a 2 phase validation.After your validation we will also validate your account so please be patient.We will inform you as soon as our validation terminates...
  

  


  

  

  



  


   Validate
  
  

  
  
  

  

  


  

  

  

  




  

  
  

  



  

  
  	This is a sample template from BEE free email editor Visit beefree.io to create beautiful and rich email messages at no cost.
  

  




  

  
  
  
  




Re: [web2py] Re: Check to establish whether or not a record exists

2016-11-21 Thread António Ramos
I used this compact way and i noticed it only returns one record.

for example

table db.badass
id   name   value
1trump   10
2trump   20
3hilary30

db.badass(name="trump")
only returns record with id =1

Regards
António

2016-11-21 15:47 GMT+00:00 Massimo Di Pierro :

> It depends
>
> a query is always field==value so you can do
>
>query = db.table.field ==  value
>row = db(query).select(limitby=(0,10)).first()
>
> or
>
>row = db.table(query)
>
> (they are equivalent)
>
> But db.table(...) can take an "implicit query"
>
>db.table(fieldname=value)
>
> which is a more compact way to do
>
>db.table(db.table.field==value)
>
> The most common way to use db.table(...) is this
>
>db.table(id)
>
> or
>
>db.table(id, fieldname=value) # returns the record only of the
> fieldname==value
>
> or
>
>db.table(id, query) # returns the record only if the query is true.
>
>
>
> On Sunday, 20 November 2016 09:08:38 UTC-6, Meinolf wrote:
>>
>> Hi Massimo
>>
>> Just came across this post and got a bit alarmed, so when i check if a
>> record exists i don't have to use the usual '==' but instead '=' ?
>>
>> On Monday, October 10, 2011 at 3:55:27 PM UTC+2, Massimo Di Pierro wrote:
>>>
>>> row = db.postcode_cache(postcode=postcode)
>>> if not row:
>>> db.postcode_cache.insert(postcode=postcode,nearset=nearest)
>>> elif not row.nearest: row.update_record(nearset=nearest)
>>> else: pass # do nothing
>>>
>>> On Oct 10, 8:22 am, Chris Rowson  wrote:
>>> > Hi list,
>>> >
>>> > I have a database table which looks like this:
>>> >
>>> > postcode_cache
>>> > 
>>> > postcode (UNIQUE)
>>> > lat
>>> > lon
>>> > nearest
>>> >
>>> > I want to test first whether or not a record exists for 'postcode' and
>>> > if a record does exist, I want to check whether the 'nearest' field
>>> > contains any data.
>>> >
>>> > I've tried this:
>>> >
>>> > if db(db.postcode_cache.postcode==postcode).select().first()==None:
>>> > create_a_new_postcode_record()
>>> >
>>> > elif 
>>> > db(db.postcode_cache.postcode==postcode).select(db.postcode_cache.nearest)=
>>> =None:
>>> > populate_the_nearest_field()
>>> >
>>> > else:
>>> > nothing_to_do()
>>> >
>>> > And while the check to establish whether or not a record exists seems
>>> > to work, the check to see whether or not the 'nearest' field within
>>> > the record is populated doesn't seem to work.
>>> >
>>> > Can anyone tell me what I'm doing wrong please?
>>> >
>>> > Thank you,
>>> >
>>> > Chris
>>
>> --
> 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-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Error code: 504-loadbalancer

2016-11-21 Thread Alberto Gedaly


I am trying to load my website which is hosted on PythonAnywhere but it is 
showing me the 504-loadbalancer error. This started happening after I 
installed the SQLEDITABLE plugin and started testing it (I tried to add 
some records to my table using the SQLEDITABLE).


My error log says: 

2016-07-20 04:25:36,003 :IOError: write error2016-07-20 04:25:36,004 :Error 
running WSGI applicationTraceback (most recent call last):
  File "/bin/user_wsgi_wrapper.py", line 156, in __call__
yield responseGeneratorExit


>From my reading, it seems the error means that my website was trying to 
send some data back to a browser, but the browser closed the connection 
before it had finished sending. This is in fact what happened. But now my 
question is, how do I solve this if I can't even reach my admin page on 
web2py?


-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: SQLFORM.FACTORY editing a document. Save reports no upload files

2016-11-21 Thread Kenwyn Pilgrim
I too have this issue with using SQLFORM.factory to edit.

My model looks like:

db.define_table('upload_file',

Field('doc_type', 'reference document_type', required=True, 
label=T('Type')),

Field('pdf_name', 'upload', label=T('PDF Document'),

  uploadfolder=os.path.join(request.folder, 'uploads', 
'user_data')),...)


my controller looks like:

...


edit_mode = len(request.args) > 0

if edit_mode:

id = int(request.args[0])

q = db.upload_file.id == id

rows = db(q).select()

for row in rows:

for field in row:

if field in db.upload_file.fields:

db.upload_file[field].default = row[field]

 

... 

form = SQLFORM.factory(db.upload_file, fields=fields,

   submit_button=T('Add to Print Queue') if not edit_mode 
else T('Update Queue'),

   upload=URL('download'))

... 


If I am in edit mode and hit the "Update Queue" button, I get the validation 
error "Please select a file", even though I have prepopulated the defaults.

I have to click the "Choose File" button to select a file *again, *then it 
works.


Please help.

Thanks.


On Saturday, April 6, 2013 at 11:22:32 AM UTC-5, Massimo Di Pierro wrote:
>
> what are the models?
>
> On Tuesday, 2 April 2013 12:19:12 UTC-5, Ramos wrote:
>>
>> Back to business after almost 2 months i try again to use sqlform.factory 
>> to create and edit documents
>> My problem was to generate the link
>> i rearranged my code as follows
>>
>>
>> #if edit a document
>>  if request.args(0):
>>
>> row=db((db.trabalhador.id==request.args(0))).select().first()
>> 
>> empresa=row.empresa
>> 
>> foto=row['foto'] or None
>> #print foto
>> if row:
>> for field in row:
>>
>> if field in db.trabalhador.fields:
>>#POPULATE FIELDS with record to edit
>> db.trabalhador[field].default=row[field]
>>
>> form=SQLFORM.factory(db.trabalhador,db.t_docs,
>> submit_button="Gravar",
>> 
>> fields=['nome','bi','ncart','ncartval','rfid','apt_medica','apt_medicaval','val_formacao','f_doc'],
>> table_name='trabalhador',
>> upload=URL('download')
>> )
>>
>> I see my record and upload fields with [file] link. The [file] link 
>> downloads my uploaded file.
>> My upload fields have required= true in db.py!!!
>> I do nothing and just press save
>>
>> I get the error   saying that i have to select a file to my upload field.
>>
>> I´m stuck
>>
>> Help please.
>>
>

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Check to establish whether or not a record exists

2016-11-21 Thread Massimo Di Pierro
It depends

a query is always field==value so you can do

   query = db.table.field ==  value
   row = db(query).select(limitby=(0,10)).first()

or

   row = db.table(query)

(they are equivalent)

But db.table(...) can take an "implicit query"

   db.table(fieldname=value)

which is a more compact way to do

   db.table(db.table.field==value)

The most common way to use db.table(...) is this

   db.table(id)

or

   db.table(id, fieldname=value) # returns the record only of the 
fieldname==value

or 

   db.table(id, query) # returns the record only if the query is true.



On Sunday, 20 November 2016 09:08:38 UTC-6, Meinolf wrote:
>
> Hi Massimo
>
> Just came across this post and got a bit alarmed, so when i check if a 
> record exists i don't have to use the usual '==' but instead '=' ?
>
> On Monday, October 10, 2011 at 3:55:27 PM UTC+2, Massimo Di Pierro wrote:
>>
>> row = db.postcode_cache(postcode=postcode) 
>> if not row: 
>> db.postcode_cache.insert(postcode=postcode,nearset=nearest) 
>> elif not row.nearest: row.update_record(nearset=nearest) 
>> else: pass # do nothing 
>>
>> On Oct 10, 8:22 am, Chris Rowson  wrote: 
>> > Hi list, 
>> > 
>> > I have a database table which looks like this: 
>> > 
>> > postcode_cache 
>> >  
>> > postcode (UNIQUE) 
>> > lat 
>> > lon 
>> > nearest 
>> > 
>> > I want to test first whether or not a record exists for 'postcode' and 
>> > if a record does exist, I want to check whether the 'nearest' field 
>> > contains any data. 
>> > 
>> > I've tried this: 
>> > 
>> > if db(db.postcode_cache.postcode==postcode).select().first()==None: 
>> > create_a_new_postcode_record() 
>> > 
>> > elif 
>> db(db.postcode_cache.postcode==postcode).select(db.postcode_cache.nearest)= 
>> =None: 
>> > populate_the_nearest_field() 
>> > 
>> > else: 
>> > nothing_to_do() 
>> > 
>> > And while the check to establish whether or not a record exists seems 
>> > to work, the check to see whether or not the 'nearest' field within 
>> > the record is populated doesn't seem to work. 
>> > 
>> > Can anyone tell me what I'm doing wrong please? 
>> > 
>> > Thank you, 
>> > 
>> > Chris
>
>

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Allow multiple login methods in web2py

2016-11-21 Thread Tommaso Bonato
Hello, I am building an application using web2py and I am not sure how I 
can enable multiple authentication methods at the same time. For example I 
would like to use both Google and Facebook OAuth and also allow the user to 
sign up using the default web2py authentication system. Right now I have 
implemented the Google OAuth and it works but I am not able to add other 
methods.

I think the main problem is this line of code where i define the 
authentication "system" for web2py. I tried reading the book but couldn't 
really find something helpful.

auth.settings.login_form=googleAccount()

Il gruppo consente fino a 5 tag separati da virgola per argomento

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] why DAL decode_credentials=True can't work for task scheduler worker?

2016-11-21 Thread DengFeng Mao
I am using web2py Version 2.14.3-stable+timestamp.2016.03.26.23.02.02 with 
Mysql
There is '@' in mysql password, Then I set  decode_credentials=True in DAL.
The web access and mysql access work well.
Then I tried to add a task scheduler. The db table 'db.scheduler_task' , 
'db.scheduler_run', 'db.scheduler_worker' tables were created automatically 
by the database migration.
Question was coming when I tried to start a worker process with the 
following command:
 ./web2py  -K  myapp

The error like this:
-
RuntimeError: Failure to connect, tried 5 times:
OperationalError: (1045, u"Access denied for user   ...
---

It confused me. There is no any issue for the web access database.  But 
scheduler worker process can't connect database.
Why?  I had thought  both web and scheduler worker use the same DAL 
connection

I tired mysql password without '@' and  DAL decode_credentials=False.
scheduler worker process can connect database as expectation. But it 
complaint
---
InternalError: (1050, u"Table 'auth_user' already exists")


I know , I should set 'migrate=False' for the table 'auth_user'. But I 
wonder why the web access process didn't complain that error?
Only scheduler worker process complaint  it

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] db showing none

2016-11-21 Thread Divyanshu Srivastava

Hi ! 
I'm just getting started with web2py

in db.py 
db = DAL(myconf.get('db.uri'),
 pool_size=myconf.get('db.pool_size'),
 migrate_enabled=myconf.get('db.migrate'),
 check_reserved=['all'])
and in shell 

db  is showing none

i've tried DAL('sqlite://storage.sqlite',pool_size=1,check_reserved=['all'])

Pls help!

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Create form for table

2016-11-21 Thread Eduardo A. Saad
Hello All,

I'm new to web2py. I'm on mac os x.

I managed to:
1. Install web2py.
2. Run it.
3. Create new application, similar to welcome.
4. Create table. (It started working when I added config related code).

I want to create a form to view - add - update - delete data from my table.
How do I do this?

Thanks! Bests. E

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: web2py_osx on Sierra (OSX 10.12)

2016-11-21 Thread Jared McFarland
I've also run into this. I'm on macOS 10.12.1

I downloaded the web2py app 
from http://www.web2py.com/examples/static/web2py_osx.zip

When I try to run it, I get the same web2py error 
dialog: http://take.ms/IIXG5

Here are the details from the console: http://take.ms/tTTgG

"Detected missing constraints for .  It cannot be placed because 
there are not enough constraints to fully define the size and origin. Add 
the missing constraints, or set 
translatesAutoresizingMaskIntoConstraints=YES and constraints will be 
generated for you. If this view is laid out manually on macOS 10.12 and 
later, you may choose to not call [super layout] from your override. Set a 
breakpoint on DETECTED_MISSING_CONSTRAINTS to debug. This error will only 
be logged once."



On Sunday, October 30, 2016 at 1:09:58 PM UTC+1, Scott Hunter wrote:
>
> I downloaded a fresh copy of the source version, ran it using the default 
> python in OS X, and all ran fine.
>
> I installed Anaconda python 2.7, ran the source version using it, and all 
> ran fine.
>
> However, I was able to run the OS X version by executing the 
> Content/MacOS/web2py executable inside of web2py.app via the command line.
>
> Then I tried executing that same OS X version by double-clicking the app; 
> it presented me with a different dialog: that it was from an unknown 
> developer, and would not open it.  But I could open it from the Security 
> panel of System Preferences, and it worked fine.
>
> I next tried to download the same .zip file from a different server (as my 
> ultimate goal is to distribute my appliance via such an executable).  That 
> exhibited the problematic behavior that I have reported previously.
>
> Lastly, I re-downloaded the zipped-app from the web2py site; opening that 
> (via double-clicking) is now experiencing the behavior previously reported. 
>  But I *can* open it via the command line as described above.  And after 
> doing so, it will open via double-click.
>
> So the "source" of the problem seems to have been trying to download from 
> a different server.  WHY that would cause a problem, I haven't a clue.  But 
> I could get around it by adding a script to open the execrable directly.
>
> - Scott
>
>
> On Saturday, October 29, 2016 at 10:42:08 PM UTC-4, Massimo Di Pierro 
> wrote:
>>
>> I would recommend you download Anaconda python 2.7 and run python from 
>> source
>> http://web2py.com/examples/static/web2py_src.zip
>>
>> If it also fails, it may give more info.
>>
>> On Tuesday, 25 October 2016 11:55:32 UTC-5, Scott Hunter wrote:
>>>
>>> Sure, but there's not much to see.
>>>
>>> When I launch the app (after Safari, presumably, has unzipped it), I get:
>>>
>>>
>>> 
>>>
>>> I click Open, and (after a little wait) am presented with:
>>>
>>>
>>> 
>>>
>>> If there is something relevant in the Console, it isn't obvious to me.
>>>
>>> - Scott
>>>
>>> On Tuesday, October 25, 2016 at 10:39:41 AM UTC-4, Roberto Perdomo wrote:

 I'm using Web2py 2.14.6 in sierra and cannot reproduce your errors.

 Can you show the errors or warnings?

 El 25 oct. 2016 10:36 AM, "Scott Hunter"  
 escribió:

> Am I to interpret from the deafening silence that I am the only one 
> seeing this problem?  Even if that is the case, any ideas how I can 
> resolve 
> it, or where I might go to find any?
>
> - Scott
>
> On Wednesday, October 19, 2016 at 12:17:45 PM UTC-4, Scott Hunter 
> wrote:
>>
>> When I download & run a fresh copy of the web2py_osx app, I get the 
>> usual warnings about it not being from a known source (b/c it is 
>> unsigned, 
>> I presume).  In previous versions, when I told the Security System 
>> Preference panel to open it anyway, it did, and all was well.  But now, 
>> soon after it launches, I get an all-but-useless error alert "web2py 
>> error" 
>> with the choices of Show Console (which reveals nothing to my eye) or 
>> Terminate.
>>
>> This is happening on 2 separate machines running Sierra.
>>
>> I'm at a loss as to what, if anything, I can do about it.
>>
>> - Scott
>>
> -- 
> 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-users" group.
> To unsubscribe from this group and stop receiving emails from it, send 
> an email to web2py+un...@googlegroups.com.
> For more 

[web2py] web2py remote access

2016-11-21 Thread Mark C
Hello.  I've installed web2py on rhel 6 and have successfully connected to 
the admin interface (ssh tunneling), but was interested in calling 
controllers over port 80 from remote machines.  Just testing around now, so 
ssl is not required.  Many thanks for any thoughts.

I'm on the 2nd web2py video (hello world) by Di Pierro, so sorry if I'm on 
the verge of this information from the vid :)

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] keyerror in update SQLFORM

2016-11-21 Thread Gaurav Vichare
Posting it again because my last post(7 days old) was not approved.

I am facing issue while updating record using SQLFORM when readable and 
writable is False for id field and record_versioning is on. I am explaining 
this issue with example app 'mywiki' given in web2py book 
.

I only added following line in db.py to enable record versioning and to 
hide id field in forms. Did no changes in controller or other code.

db._common_fields.append(auth.signature)

db.define_table('page',
Field('title'),
Field('body', 'text'),
Field('created_on', 'datetime', default=request.now),
Field('created_by', 'reference auth_user', 
default=auth.user_id),
format='%(title)s')

db.page.id.readable = db.page.id.writable = False
# other table definations.


auth.enable_record_versioning(db) # at the end of file

here is edit controller function:

def edit():
"""edit an existing wiki page"""
this_page = db.page(request.args(0, cast=int)) or redirect(URL('index'))
form = SQLFORM(db.page, this_page).process(
next = URL('show', args=request.args))
return dict(form=form)

Now when I submit the update form without updating anything in form,

I got error- KeyError: 'id' Here is complete traceback 
https://paste.ubuntu.com/23442757/

I debugged through web2py framework code and found that error comes while 
creating entry in archive table, and only when writable False and that to 
for id field because _filter_fields filters out id field.

I think, I am missing something simple here I am using web2py-2.14.6.

Also posted this on stackoverflow 



Please help me to fix the error!

Thank You

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] How to solve vertical alignment too high of SQLForm read-only field

2016-11-21 Thread Martin de Groot
In a SQLForm all widget-controls of writable fields are nicely, correctly 
vertically aligned with the preceding label.

However, when one adds db.table.field.writable = False in the 
contrller-action function the widget-control is correctly changed from an 
input control to a read-only control, but the text of the field's value is 
placed noticeably higher than the text of the preceding label.

I have been looking into the html source code of the resulting page, to see 
if I could figure out which style I could apply in an extra .css file 
statement, but I cannot  find anything.

I am sure many other users have observed this vertical alignment being too 
high , especially if the text in the field is just on one line.

I would very much appreciate it if anyone can suggest a solution for this. 
Apart from making a custom form, which is a lot more work than using the 
SQLForm generated code.

Martin de Groot

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] issue with redirect to login page, the .load propagate in case of component NOT AUTHORIZED

2016-11-21 Thread Emiliano Torrano
Richard,



I could fix it changing the following auth.message:

auth.messages.ajax_failed_authentication

For example:

auth.messages.ajax_failed_authentication = DIV(H4(T('Your session has 
expired')),
T('Please '),
A(T('login'),
  _href=auth.settings.login_url +
('?_next=' + 
urllib.quote(request.env.http_web2py_component_location))
  if request.env.http_web2py_component_location 
else ''),
T(' again to view this content.'),
_class='not-authorized alert alert-block')



El martes, 19 de noviembre de 2013, 18:18:14 (UTC-2), Richard escribió:
>
> Any solution for this problem?
>
> Richard
>
>
> On Thu, Sep 19, 2013 at 12:43 PM, Richard Vézina  > wrote:
>
>> Nop... auth.settings.login_url work even if user is disconnect.
>>
>> Richard
>>
>>
>> On Thu, Sep 19, 2013 at 12:31 PM, Richard Vézina > > wrote:
>>
>>> Or db.py auth.settings.login_url = URL(...) is just not executed in case 
>>> the user is not logged?
>>>
>>> Richard
>>>
>>>
>>> On Thu, Sep 19, 2013 at 12:27 PM, Richard Vézina >> > wrote:
>>>
 Hello,

 It seems that auth.settings.*login_url* = URL('default', 'user', 
 args='login', extension=False) works at least in context where the user 
 access site and get redirect to login page...

 But for some reason, it seems that self.settings.login_url in the code 
 below :

 messages.update(ajax_failed_authentication=DIV(H4('NOT AUTHORIZED'),
 'Please ',
 A('login',
   _href=*self.settings.login_url* +
   ('?_next=' + 
 urllib.quote(current.request.env.http_web2py_component_location))
   if current.request.env.http_web2py_component_location 
 else ''),
 ' to view this content.',
 _class='not-authorized alert alert-block'))

 Get override or the auth init get call again in context of component 
 and auth.settings.login_url = URL(...) from db.py is ignored??

 Richard


 On Wed, Sep 18, 2013 at 4:32 PM, Richard Vézina  wrote:

> Ok, I miss understand the utility of default_settings, it is not 
> initialize the Auth settings list... 
>
> I guess we need something like login_next...
>
> Will see what I can do tomorrow...
>
> Richard
>
>
> On Wed, Sep 18, 2013 at 4:01 PM, Richard Vézina  > wrote:
>
>> Adding this, after line 928 :
>>  url_login = URL(c='default', f='user', args='login')
>>
>> And changing line 1163-1164 for this :
>> url_login = self.default_settings['url_login']
>>
>> Solve it, thought, I don't know why I don't need 
>> auth.settings.url_login = URL(default','user',args='login', 
>> extension=False) to make it works properly...
>>
>> So, I guess it not works the way you want it to do... Futher tests 
>> are required...
>>
>> Richard
>>
>>
>> On Wed, Sep 18, 2013 at 3:27 PM, Richard Vézina <
>> ml.richa...@gmail.com > wrote:
>>
>>> I think we need to add url_login in Auth init, I get  >> 'exceptions.SyntaxError'> setting key 'url_login' does not exist 
>>> I try login_url, it don't return ticket but it not working...
>>>
>>> web2py 2.4.7
>>>
>>> Richard
>>>
>>>
>>> On Wed, Sep 18, 2013 at 3:21 PM, Richard Vézina <
>>> ml.richa...@gmail.com > wrote:
>>>
 Right!

 That what I thougth to do at first I should had just did that 
 instead of fixing something :)

 Thanks.

 Richard


 On Wed, Sep 18, 2013 at 2:54 PM, Massimo Di Pierro <
 massimo@gmail.com > wrote:

> This cannot be fixed at the level of gluon/tools.py because some 
> users may want an ajax login form. Those users should be free to 
> create a 
> default/user.load view.
> In your case you simply need to do (in model):
>
> auth.settings.url_login = URL('default','user',args='login', 
> extension=False)
>
>
>
> On Wednesday, 18 September 2013 08:51:08 UTC-5, Richard wrote:
>
>> Adding extention='html' at line 1163 in tools.py seems to solve 
>> the issue :
>>
>> url_login = URL(controller, function, args='login', 
>> extension='html')
>>
>> Or extension=False
>>
>> url_login = URL(controller, function, args='login', 
>> extension=False)
>>
>> The latter probably better
>>
>> Richard
>>
>>

[web2py] Error when trying to submit or edit new data using sqlform.grid

2016-11-21 Thread Hugo

Hello,

I am facing an error when using web2py sqlform.grid that I am not 
understanding why.

I have the controller where I define the form:

def search_records():

if request.vars:
selectable = request.vars.z
DBconn = db._uri

name = searchtable(selectable)

try:
form = SQLFORM.grid(query=name, orderby=None, searchable=True, 
sortable=True, paginate=20, deletable=True,
editable=True, details=True, selectable=None, 
user_signature=False, create=True, csv=False,
links=None, links_in_grid=True, maxtextlength=100, 
sorter_icons=('[^]', '[v]'),
ui='jquery-ui', showbuttontext=True, 
_class="web2py_grid", formname='web2py_grid',
search_widget='default', ignore_rw=True)

response.view = 'default/search_records.html'

except:
redirect(URL('default', 'index'))


return dict(form=form, selectable=selectable)


the function searchtable returns the table to present in the grid, so the 
variable name is spmething like: db.TABLE_TO_PRESENT

The view page returns what is expected with the respective links "add 
record", "view", "edit" and "delete. The error comes when I use the link 
"add record" or "edit". After opining the correct page to insert the data, 
when clicking submit it shows the error:

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.

Traceback (most recent call last):
  File "...\web2py\gluon\restricted.py", line 227, in restricted
exec ccode in environment
  File ".../applications/Mappings/controllers/search_records.py" 
,
 line 44, in 
  File "...\web2py\gluon\globals.py", line 417, in 
self._caller = lambda f: f()
  File ".../web2py/applications/Mappings/controllers/search_records.py" 
,
 line 36, in search_records
return dict(form=form, selectable=selectable)
UnboundLocalError: local variable 'form' referenced before assignment


So it seems that it loses the information relative to that form that was 
previously loaded.

I am trying to understand the reason for this but I can't get to any 
conclusion. Can anyone help me?

Thank you.



-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Versioning Erro

2016-11-21 Thread Gilberto Diaz
I just start a Web2Py project in pythoneverywhere.com.  I want to start 
with some version control so I clicked Versioning at the toolbar and gave 
it a name . After clicking commit I'm getting the 
following error...  
Ticket ID

184.61.59.121.2016-11-12.04-14-30.64632ebd-cdac-4f2b-bcca-5711784094d6
 addremove() takes at least 3 arguments (1 
given)

Does anyone know how to fix this problem?

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] headers of SQLFORM.grid doesn't work when using alias columns in a self-joined table

2016-11-21 Thread Hammer Lee
Hello,

I'm using SQLFORM.grid to show a self-joined table for boss and employee. I 
want to show both employee's and boss's names, tittles & emails with 
different headers to distinguish bosses and employees. However, 
SQLFORM.grid doesn't replace original labels with headers on those 
duplicated columns, such as name, title and emails. 

Here is my code, 

deptHead = mssql.EMP.with_alias('depthead')
form = SQLFORM.grid(query...,  fields=[...],
headers = {'EMP.GIVENNAME' : 'Employee' , 'EMP.CN' : 'EMP_ID' , 
'EMP.DEPTHEAD' : 'BOSS_ID' ,
'deptHead.GIVENNAME' : 'BOSS' , 'deptHead.TITLE':'BOSS_TITLE', ...},

headers works only on EMP.CN and EMP.DEPTHEAD, but not for duplicated 
columns such as EMP.GIVENNAME & deptHead.GIVENNAME.

How should I do to work around?

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Need help with VideoTest!!

2016-11-21 Thread Sharad Shrestha
I am trying to upload and play video using web2py. 

I am able to upload and play video. However, everytime I upload video I 
have to run this code in termial. 

To run VideoTest:
# cd /path/to/web2py/
# nohup python web2py.py -S VideoTest -M -R 
applications/VideoTest/modules/video_to_flv.py



Is there anyway I can put this code in controller? So, I don't have to use 
terminal every time I upload video.


Here is the link for code:

https://github.com/mdipierro/web2py-appliances/tree/master/VideoLibrary

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: what is in the cache ?

2016-11-21 Thread Pierre
I understand  use-cases for 
time_expire=None


but I don't see a use-case for 
time_expire=0



when you do  
cache.redis('message', lambda: 'Hello', time_expire=0)

all the subsequent *cache.redis('message',)* will overwrite Hello

to get a persistent Hello you have to write something like:

cache.redis('message', None)
cache.redis('message',lambda: 'Hello', time_expire=None)

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: info: w3 css, responsive

2016-11-21 Thread eric cuver
I use w3 css it works well with web2py and cordova

Le lundi 21 novembre 2016 13:17:41 UTC+1, Mirek Zvolský a écrit :
>
> not web2py, but looks interesting.
>
> http://www.w3schools.com/w3css/default.asp
>
> On mobile pages load instantly. In oposite to bootstrap3.
>
> Does somebody use it ?
>
>
>

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Custom html email on auth.settings.registration_requires_verification = True

2016-11-21 Thread António Ramos
but if i set tempvar=my previous response.render('templates/ema
il_verification.html')

then i do
mail.send(to="myemail",subject="a",message=("",tempvar),sender="somesender..")

i get the email!

but if i register a new user i get the previous error...

2016-11-21 14:05 GMT+00:00 António Ramos :

> my template is just html without any {{=var}} inside...
>
> 2016-11-21 14:04 GMT+00:00 António Ramos :
>
>> when i just use response.render without a dict , for ex...
>>
>> response.render('templates/email_verification.html')
>>
>> i get an error about invalid "!" in the template
>> [image: Imagem inline 1]
>>
>>
>> 2016-11-21 13:21 GMT+00:00 Leonel Câmara :
>>
>>> username is passed by auth, and it's not necessarily the "username"
>>> field it can be the email if you're not using an username.
>>>
>>> Basically after register if you have registration_requires_verification
>>> auth send an email where the body is defined as
>>>
>>> d = dict(form.vars) # form.vars holds the registration form values
>>> d.update(dict(key=key, link=link, username=form.vars[username])) #
>>> exactly what username is, is defined earlier according to your settings
>>> email_body = messages.verify_email % d
>>>
>>>
>>> You can actually build verify_email using html helpers if you aren't
>>> being able to do it with response.render
>>>
>>> auth.messages.verify_email = HTML(
>>> HEAD(),
>>> BODY(
>>> H1(T('Welcome to MY AMAZING WEBSITE'
>>> )),
>>> P(T('Click on the link below to
>>> check your e-mail'), ':'),
>>> A(URL(r=request,c='default',f='user'
>>> ,args=['verify_email'], scheme=True, host=True) + '/%(key)s ', _href=URL
>>> (r=request,c='default',f='user',args=['verify_email'], scheme=True, host
>>> =True) + '/%(key)s '),
>>> P(T('Thank You')),
>>> P(T('From MY AMAZING WEBSITE')),
>>> )
>>>  ).xml()
>>>
>>> Another alternative is to just use a string with HTML in there.
>>>
>>> --
>>> 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-users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to web2py+unsubscr...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Custom html email on auth.settings.registration_requires_verification = True

2016-11-21 Thread António Ramos
my template is just html without any {{=var}} inside...

2016-11-21 14:04 GMT+00:00 António Ramos :

> when i just use response.render without a dict , for ex...
>
> response.render('templates/email_verification.html')
>
> i get an error about invalid "!" in the template
> [image: Imagem inline 1]
>
>
> 2016-11-21 13:21 GMT+00:00 Leonel Câmara :
>
>> username is passed by auth, and it's not necessarily the "username" field
>> it can be the email if you're not using an username.
>>
>> Basically after register if you have registration_requires_verification
>> auth send an email where the body is defined as
>>
>> d = dict(form.vars) # form.vars holds the registration form values
>> d.update(dict(key=key, link=link, username=form.vars[username])) #
>> exactly what username is, is defined earlier according to your settings
>> email_body = messages.verify_email % d
>>
>>
>> You can actually build verify_email using html helpers if you aren't
>> being able to do it with response.render
>>
>> auth.messages.verify_email = HTML(
>> HEAD(),
>> BODY(
>> H1(T('Welcome to MY AMAZING WEBSITE'
>> )),
>> P(T('Click on the link below to
>> check your e-mail'), ':'),
>> A(URL(r=request,c='default',f='user',
>> args=['verify_email'], scheme=True, host=True) + '/%(key)s ', _href=URL(r
>> =request,c='default',f='user',args=['verify_email'], scheme=True, host=
>> True) + '/%(key)s '),
>> P(T('Thank You')),
>> P(T('From MY AMAZING WEBSITE')),
>> )
>>  ).xml()
>>
>> Another alternative is to just use a string with HTML in there.
>>
>> --
>> 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-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to web2py+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Custom html email on auth.settings.registration_requires_verification = True

2016-11-21 Thread António Ramos
when i just use response.render without a dict , for ex...

response.render('templates/email_verification.html')

i get an error about invalid "!" in the template
[image: Imagem inline 1]


2016-11-21 13:21 GMT+00:00 Leonel Câmara :

> username is passed by auth, and it's not necessarily the "username" field
> it can be the email if you're not using an username.
>
> Basically after register if you have registration_requires_verification
> auth send an email where the body is defined as
>
> d = dict(form.vars) # form.vars holds the registration form values
> d.update(dict(key=key, link=link, username=form.vars[username])) #
> exactly what username is, is defined earlier according to your settings
> email_body = messages.verify_email % d
>
>
> You can actually build verify_email using html helpers if you aren't being
> able to do it with response.render
>
> auth.messages.verify_email = HTML(
> HEAD(),
> BODY(
> H1(T('Welcome to MY AMAZING WEBSITE'
> )),
> P(T('Click on the link below to check
> your e-mail'), ':'),
> A(URL(r=request,c='default',f='user',
> args=['verify_email'], scheme=True, host=True) + '/%(key)s ', _href=URL(r=
> request,c='default',f='user',args=['verify_email'], scheme=True, host=True
> ) + '/%(key)s '),
> P(T('Thank You')),
> P(T('From MY AMAZING WEBSITE')),
> )
>  ).xml()
>
> Another alternative is to just use a string with HTML in there.
>
> --
> 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-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Custom html email on auth.settings.registration_requires_verification = True

2016-11-21 Thread Leonel Câmara
username is passed by auth, and it's not necessarily the "username" field 
it can be the email if you're not using an username.

Basically after register if you have registration_requires_verification 
auth send an email where the body is defined as

d = dict(form.vars) # form.vars holds the registration form values
d.update(dict(key=key, link=link, username=form.vars[username])) # exactly 
what username is, is defined earlier according to your settings
email_body = messages.verify_email % d


You can actually build verify_email using html helpers if you aren't being 
able to do it with response.render

auth.messages.verify_email = HTML(
HEAD(),
BODY(
H1(T('Welcome to MY AMAZING WEBSITE')),
P(T('Click on the link below to check 
your e-mail'), ':'),
A(URL(r=request,c='default',f='user',
args=['verify_email'], scheme=True, host=True) + '/%(key)s ', _href=URL(r=
request,c='default',f='user',args=['verify_email'], scheme=True, host=True) 
+ '/%(key)s '),
P(T('Thank You')),
P(T('From MY AMAZING WEBSITE')),
)
 ).xml()

Another alternative is to just use a string with HTML in there.

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Custom html email on auth.settings.registration_requires_verification = True

2016-11-21 Thread 黄祥
perhaps you define username = False, not using username in auth_user
e.g.
auth.define_tables(username = False, signature = True)
auth.messages.verify_email = response.render('templates/mail/test.html', 
  dict(link = link) )

best regards,
stifan

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Custom html email on auth.settings.registration_requires_verification = True

2016-11-21 Thread António Ramos
Leonel,
the code

auth.messages.verify_email = response.render('templates/mail/test.html',
   dict(username = username, link = link) )
does not know what username is...
*Username is not defined...*

Thank you

2016-11-19 21:31 GMT+00:00 黄祥 :

> perhaps you can use response.render in there
> e.g.
> auth.messages.verify_email = response.render('templates/mail/test.html',
>   dict(username = username, link = link) )
>
> best regards,
> stifan
>
> --
> 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-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] info: w3 css, responsive

2016-11-21 Thread Mirek Zvolský
not web2py, but looks interesting.

http://www.w3schools.com/w3css/default.asp

On mobile pages load instantly. In oposite to bootstrap3.

Does somebody use it ?


-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: web2py react-python

2016-11-21 Thread Mark Graves
Way better use case Leonel, thanks =)

On Mon, Nov 21, 2016 at 3:44 AM, Leonel Câmara 
wrote:

> José a use case may be for graceful degradation when clients don't have
> javascript.
>
> --
> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/web2py/GwaHrT4Dqxg/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] does field object know it's tablename?

2016-11-21 Thread Jurgis Pralgauskis
or should I pass tablename to function alongside?

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: strange behavior of $@ bash parameter expansion

2016-11-21 Thread Mirek Zvolský
I'm sorry.
Primary reason (probably) was (of course) in my code. I have redirect 
inside model (maybe not good idea) and I missed the URL() function like so:
  redirect('library', 'choose_library')

Some unexpected behaviour later was maybe from current state of trunk 
(where I see lot of new work!, thanks).






On Monday, 7 November 2016 18:28:22 UTC+1, Mirek Zvolský wrote:
>
> I use Debian (testing), Postgres 9.4,
> and Web2py 2.14.6 (with current trunk is problem the same)
>
> I use such command (assigned to an alias) for long time to start my 
> application
> python web2py.py -K codex2020 -X $@
>
> Today I received strange behaviour, errors like
> web2py.scheduler TICKER: error assigning tasks
> or such something (with no effect if I have deleted scheduler_* tables and 
> their databases/ metadata earlier)
> starting scheduler for "codex2020"... 
> Currently running 1 scheduler processes 
> Traceback (most recent call last): 
>  File "/home/mirek/mz/web2py/gluon/restricted.py", line 227, in restricted 
>exec ccode in environment 
>  File "applications/codex2020/models/scheduler.py", line 80, in  
>scheduler = Scheduler(db) 
>  File "/home/mirek/mz/web2py/gluon/scheduler.py", line 567, in __init__ 
>self.define_tables(db, migrate=migrate) 
>  File "/home/mirek/mz/web2py/gluon/scheduler.py", line 659, in 
> define_tables 
>migrate=self.__get_migrate('scheduler_worker', migrate) 
>  File "/home/mirek/mz/web2py/gluon/packages/dal/pydal/base.py", line 834, 
> in define_table 
>table = self.lazy_define_table(tablename,*fields,**args) 
>  File "/home/mirek/mz/web2py/gluon/packages/dal/pydal/base.py", line 873, 
> in lazy_define_table 
>polymodel=polymodel) 
>  File "/home/mirek/mz/web2py/gluon/packages/dal/pydal/adapters/base.py", 
> line 510, in create_table 
>fake_migrate=fake_migrate 
>  File "/home/mirek/mz/web2py/gluon/packages/dal/pydal/adapters/base.py", 
> line 623, in migrate_table 
>self.execute(sub_query) 
>  File 
> "/home/mirek/mz/web2py/gluon/packages/dal/pydal/adapters/postgres.py", line 
> 362, in execute 
>return BaseAdapter.execute(self, *a, **b) 
>  File "/home/mirek/mz/web2py/gluon/packages/dal/pydal/adapters/base.py", 
> line 1388, in execute 
>return self.log_execute(*a, **b) 
>  File "/home/mirek/mz/web2py/gluon/packages/dal/pydal/adapters/base.py", 
> line 1382, in log_execute 
>ret = self.get_cursor().execute(command, *a[1:], **b) 
> ProgrammingError: column "worker_stats__tmp" is of type json but 
> expression is of type text 
> LINE 1: UPDATE scheduler_worker SET worker_stats__tmp=worker_stats; 
>  ^ 
> HINT:  You will need to rewrite or cast the expression.
>
> Then I decided then if I run without $@, all will start well:
> python web2py.py -K codex2020 -X
>
> After testing of everything I went back to:
> python web2py.py -K codex2020 -X $@
> or
> python web2py.py -K codex2020 -X "$@"
>
> and I have now no more the previous problem. All works well.
>
> Has somebody any idea about the reason of problems
> and can you explain me the difference between $@ and "$@". Which one is 
> more safe to use? Is there a difference?
>
> Thanks...
>

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: web2py react-python

2016-11-21 Thread Leonel Câmara
José a use case may be for graceful degradation when clients don't have 
javascript.

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.