[web2py] Job opening

2015-09-30 Thread weheh
I'm leading a large, multi-phase project with immediate need for additional software development human resource. We're searching for a top talent with the following full-stack expertise: - python - web2py - javascript & jQuery - ractive - Bootstrap - css - postgreSQL or MongoDB If you've got thi

Re: [web2py] Re: how to access external API

2015-09-30 Thread Alex Glaros
it pretty much works from PythonAnywhere, except it doesn't put data in the vars correctly . Data looks like this with strange letter "u" in front: {u'loc': u'38.5249,-121.9708', u'city': u'Winters', u'country': u'US', u'region': u'California', u'hostname': u'No Hostname', u'ip': u'108.70.229.

Re: [web2py] Caching - need your thoughts

2015-09-30 Thread Kiran Subbaraman
Richard, Thanks a lot for the pointers. The cache test code provided the information I needed. I had tried to look for answers only in the group and docs. Note to self: Look at the groups, docs, source and test codebase, before posting a question Kiran

[web2py] Re: Easy way to increment a field?

2015-09-30 Thread Dave S
On Wednesday, September 30, 2015 at 6:23:45 PM UTC-7, Anthony wrote: > > Yes, that's the way to do it if the calculations must be done in Python. > You can only use the direct update method if the database itself can do the > calculations (via a SQL expression). For example, here is what you ca

[web2py] Wizard inside a LOAD

2015-09-30 Thread Jose
Hi I am embedding wizard in a LOAD {{=LOAD('default', 'f1', ajax=True, ajax_trap=True)}} def f1(): form = FORM(...) if form.process().accepted: #I do something redirect(URL('f2')) return form def f2(): form = FORM(...) if form.process().accepted:

[web2py] Re: Easy way to increment a field?

2015-09-30 Thread Anthony
Yes, that's the way to do it if the calculations must be done in Python. You can only use the direct update method if the database itself can do the calculations (via a SQL expression). For example, here is what you can do in PostgreSQL: http://www.postgresql.org/docs/9.4/static/functions-math.

[web2py] Migration of java/tomcat backend

2015-09-30 Thread Joel McGraw
Hello group, long-time lurker here. I just joined a startup that has a working version of software that was created by an outsourced team. It's the backend for a mobile app and is a fairly typical tomcat/hibernate/java application. Without getting into the reasons, I'm considering migrating to web

[web2py] Re: Easy way to increment a field?

2015-09-30 Thread Dave S
On Tuesday, September 29, 2015 at 1:25:33 PM UTC-7, Anthony wrote: > > You can do it in one line - just let the database do the incrementing by > passing an expression in the .update() method: > > db(db.mytable).update(counter=db.mytable.counter + 1) > > Much more efficient because you don't hav

Re: [web2py] Re: how to access external API

2015-09-30 Thread Alex Glaros
I think you're right. Will try from home tonight. Thanks! On Wed, Sep 30, 2015 at 4:31 PM, Leonel Câmara wrote: > There must be something wrong on your side (maybe a firewall blocking > python or another network issue) because this works fine on my tests. > > -- > Resources: > - http://web2py

[web2py] Re: how to access external API

2015-09-30 Thread Leonel Câmara
There must be something wrong on your side (maybe a firewall blocking python or another network issue) because this works fine on my tests. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2p

Re: [web2py] Re: How to include session data in error tickets

2015-09-30 Thread Christopher L
Interesting - that's what I was worried about. Does anyone know how web2py decides when to include useful info/when it's able to? On Wed, Sep 30, 2015 at 4:25 PM, Dave S wrote: > > > On Wednesday, September 30, 2015 at 8:31:47 AM UTC-7, Chris wrote: >> >> Hi Stifan, >> >> Yes, that's exactly the

[web2py] Re: Nested Role Based Access Control

2015-09-30 Thread PN
No graph database needed the way we implemented it. We use a regular db and generate the graph in-memory. The current simple implementation is to query auth_permissions where table_name = 'auth_group' so we only get entries that are relevant to group-group ownerships. The graph is kept in memo

[web2py] Re: ST_X function on POSTGIS geography() fields

2015-09-30 Thread wish7code
Done: https://github.com/web2py/pydal/issues/298 Cheers Toby Am Dienstag, 29. September 2015 23:17:37 UTC+2 schrieb wish...@gmail.com: > > +1 from my side too :-) Was a pydal ticket ever opened? > Otherwise I would do now... > > Cheers > Toby > > Am Montag, 22. Juni 2015 08:51:59 UTC+2 schrieb M

[web2py] Re: how to access external API

2015-09-30 Thread Alex Glaros
only made a couple of attempts, not one thousand. And the call from browser still works so doesn't appear that number of attempts is causing it to actively refuse my IP. Also tried another company and got same error: http://api.db-ip.com/addrinfo?addr=173.194.67.1&api_key=f268dd236413839e5271

[web2py] Re: how to access external API

2015-09-30 Thread Leonel Câmara
Well the errors says it all. You connection is being refused. It appears you bumped into the 1k calls API limit by making too many calls. It has to be json.loads because fetch returns a string. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py

Re: [web2py] Re: How to include session data in error tickets

2015-09-30 Thread Dave S
On Wednesday, September 30, 2015 at 8:31:47 AM UTC-7, Chris wrote: > > Hi Stifan, > > Yes, that's exactly the part I used to see (locals, request, session, > response) that I'm not seeing anymore! Very odd. > Here's what the ticket looks like to me: http://imgur.com/kowN8eg > > > Having spent mu

[web2py] Re: how to access external API

2015-09-30 Thread Alex Glaros
Leonel, this string works from a browser (http://ipinfo.io/8.8.8.8/json) so your sample is very close to working, but am getting an error. Also, is word supposed to be "load" or "loads" or doesn't matter? Versionweb2py™Version 2.12.2-stable+timestamp.2015.08.09.14.29.44PythonPython 2.7.9: C

[web2py] Re: Nested Role Based Access Control

2015-09-30 Thread Niphlod
This has been discussed before and trashed as soon as a graph database is needed to store and retrieve efficiently data. Of course, recursive queries are a no-go. There's a reason why Active Directory through Kerberos sends out the flattened list of group membership when trying to authenticate. A

[web2py] Re: Any idea about how to interpolate into a dal query string?

2015-09-30 Thread Leonel Câmara
Use this instead query = db[field_array[3]].id ==field_array[1] db(query).select() -- 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 rece

[web2py] Re: how to access external API

2015-09-30 Thread Leonel Câmara
I haven't tried it but, this should work and it's a simple enough example # In the default controller def locateme(): import json from gluon.tools import fetch location_data = json.loads(fetch('http://ipinfo.io/%s/json' % request. client)) return location_data # In the view defa

[web2py] Any idea about how to interpolate into a dal query string?

2015-09-30 Thread Mark Billion
This fails: query = "db.%s.id==%s" %(field_array[3], field_array[1]) db(query).select() Any idea about how to interpolate into a dal query string? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://c

[web2py] how to access external API

2015-09-30 Thread Alex Glaros
Am new to APIs. How do I access this API and get data to w2p vars? http://ipinfo.io/developers Goal is read user's IP address to determine what country/city they are in. Thanks, Alex Glaros -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/

[web2py] Re: Easy way to increment a field?

2015-09-30 Thread Dave S
On Tuesday, September 29, 2015 at 1:25:33 PM UTC-7, Anthony wrote: > > You can do it in one line - just let the database do the incrementing by > passing an expression in the .update() method: > > db(db.mytable).update(counter=db.mytable.counter + 1) > > Much more efficient because you don't hav

[web2py] Nested Role Based Access Control

2015-09-30 Thread PN
Currently web2py's RBAC functionality does not accommodate nested groups. Any interest in adding this to the standard web2py access control module? *Example Use-Case* Suppose we are creating an inventory management application that lets you view addresses for buildings within your portfolio of

Re: [web2py] Re: How to include session data in error tickets

2015-09-30 Thread Christopher L
Hi Stifan, Yes, that's exactly the part I used to see (locals, request, session, response) that I'm not seeing anymore! Very odd. Here's what the ticket looks like to me: http://imgur.com/kowN8eg Thanks! -C On Tue, Sep 29, 2015 at 7:57 PM, 黄祥 wrote: > not sure, i got about your question, if

[web2py] Matplotlib

2015-09-30 Thread Laurent Lc
I 'd like to view in a view this part of code : import datetime import matplotlib.pyplot as plt x = [datetime.date(2014, 1, 29), datetime.date(2014, 4, 15), datetime.date(2014, 3, 29)] y = [2, 4, 1] fig, ax = plt.subplots() ax.plot_date(x, y, markerfacecolor='CornflowerBlue', markeredgecolor='

Re: [web2py] Caching - need your thoughts

2015-09-30 Thread Richard Vézina
About Cache, you may try to import gluon cache.py module and see if it can solve you requirement. Something like that : from cache import CacheInRam, CacheOnDisk, Cache You may need to include it in python path... Richard On Wed, Sep 30, 2015 at 8:22 AM, Kiran Subbaraman < subbaraman.ki...@gma

Re: [web2py] Caching - need your thoughts

2015-09-30 Thread Richard Vézina
https://github.com/web2py/web2py/blob/1e66fa3a93560aa5d32c27a6b1b7251e0dd8a428/gluon/cache.py Here the test file about cache : https://github.com/web2py/web2py/blob/1e66fa3a93560aa5d32c27a6b1b7251e0dd8a428/gluon/tests/test_cache.py Richard On Wed, Sep 30, 2015 at 9:33 AM, Richard Vézina wrote:

[web2py] Caching - need your thoughts

2015-09-30 Thread Kiran Subbaraman
Hello group, I have a standard web2py application, but within its modules directory, I have a bunch of code which run within the web2py context (and its scheduler), and also as scripts independent of web2py. It is just that this code resident within web2py's modules. I wanted to use the web2py c

Re: [web2py] How to build the book...

2015-09-30 Thread Willoughby
It's a big, wide world out there. Not everyone has stable electricity 24/7, nor Google Fiber to their door. :-) But I appreciate your efforts in helping the community. And as you said, Vinicius gave an elegant solution - Thanks Vinicius. Hopefully that helps out the OP. On Tuesday, September

[web2py] Re: LOAD and export to CSV

2015-09-30 Thread 'DenesL' via web2py-users
Thanks for the link Brian. Checking it out right now. On Tuesday, September 29, 2015 at 9:19:33 PM UTC-4, Brian M wrote: > > Yeah, with a little looking, and also another recent post here, you can't > start a download with JavaScript so you'll have to do something else. > Either just redirect t