[web2py] Re: Web2py - Front-end performance optimization tutorial

2015-09-16 Thread Louis Amon
> > Let's start saying that these optimizations are on the far End of your - > high end - project, right were you want to optimize till the last bit to > get < 200ms load times. This helps everyone to focus on the fact that these > operations need to be considered at that stage and that stage

[web2py] Re: Web2py - Front-end performance optimization tutorial

2015-09-16 Thread Louis Amon
> > Are you really stating that your own CDN serving jquery is better than > https://code.jquery.com/jquery-2.1.4.min.js , both for SLA and speed ? That is not what I said. First of all, this whole "put vendors in bundle or not" issue only concerns the first request of a visitor, as any

Re: [web2py] Web2py - Front-end performance optimization tutorial

2015-09-14 Thread Louis Amon
Indeed I should look into contributing the book at some point. Still feel a bit too noobish for that just yet ^^ As for Heroku & Gzip, here's the official source to my info: https://devcenter.heroku.com/articles/http-routing#gzipped-responses On Monday, September 14, 2015 at 5:26:07 AM UTC+2,

Re: [web2py] Web2py - Front-end performance optimization tutorial

2015-09-14 Thread Louis Amon
While working with caching, I noticed what seems to me like a caveat in web2py's current design. When serving static files from the webserver, you can either : - use the "static" pseudo-controller (it's actually a route built directly above the WSGI), in which case you can't set your own

[web2py] Web2py - Front-end performance optimization tutorial

2015-09-13 Thread Louis Amon
I'm opening a thread dedicated to website performance issues in web2py, giving the answers I've got so far so that other may contribute as well. Static assets (fonts, vendor CSS & JS) How do you manage & distribute these ? Fonts are easiest to manage using Google Fonts

[web2py] Re: How do I enable gzip compression in web2py using default web server?

2015-09-13 Thread Louis Amon
I know this is an old thread, but nowadays this isn't actually entirely true. Yes, Nginx will manage gzip compression like a boss, but if you use cloud hosting solutions, you may not be able to use it. Heroku for instance explicitely requires the web application to handle the compression of

[web2py] Routes : matching ?_escaped_fragment_= for AJAX websites

2015-05-04 Thread Louis Amon
According to Google's own spec https://developers.google.com/webmasters/ajax-crawling/docs/specification, it takes special routing rules for dynamic websites to be crawled. Basically, if you put meta name=fragment content=! somewhere in your head then you can split your traffic: Google bots

[web2py] json-encoded requests in web2py

2015-05-04 Thread Louis Amon
I've recently had a pretty annoying issue when using web2py with AngularJS : By default, AngularJS sends JSON-encoded requests when you use the $http service, so a POST request would look like this : {firstName:John} For some reason I don't really understand, web2py natively understands this

Re: [web2py] Re: Sticky sessions in a distributed environment

2015-05-04 Thread Louis Amon
Update Heroku now provides an elegant solution to this issue : session affinity https://blog.heroku.com/archives/2015/4/28/introducing_session_affinity https://devcenter.heroku.com/articles/session-affinity Basically, it sets a special cookie that tends to distribute users towards the dyno

[web2py] UnicodeEncodeError and request.vars

2015-04-28 Thread Louis Amon
I'm raising what seems to be an old issue with web2py : sending forms with web2py raises exceptions when using accentuated characters. Given that request.vars can be virtually anything on a production server, what is the best practice here ? Should I force request.vars keys values to be

[web2py] Advanced mechanics : Lazy tables VS response.models_to_run

2015-04-14 Thread Louis Amon
I'm trying to optimize the load-speed of my app, and I'm considering using conditional models. I've also been using lazy_tables for a while now and I can attest for the speed boost, but I don't really understand how and why. Can someone explain how lazy_tables compare to

Re: [web2py] Multiple file download

2015-04-13 Thread Louis Amon
function doesn't work... On Saturday, 11 April 2015 13:21:03 UTC+1, Louis Amon wrote: I think you'd have to loop through a selection and use retrieve() (http://pydal.readthedocs.org/en/latest/index.html?highlight=retrieve#pydal.objects.Field.retrieve http://pydal.readthedocs.org/en/latest

[web2py] Re: Multiple file download

2015-04-11 Thread Louis Amon
I think you'd have to loop through a selection and use retrieve() ( http://pydal.readthedocs.org/en/latest/index.html?highlight=retrieve#pydal.objects.Field.retrieve ) If you need a one-click download then perhaps you could zip all the files using the zip

[web2py] Publishing plugins

2015-04-11 Thread Louis Amon
I'm working on a good ton of awesome plugins and I'd like to share those with the community so that people could use them and/or contribute. I'm using these in my main application and I don't want to separate the plugins too much from my app because : - Most likely I'll improve them through

[web2py] Project : web2py-analytics, automatic event tracking in web2py

2015-04-06 Thread Louis Amon
So far Google Analytics has been part of the scaffolding application for quite some time. I'm guessing it was put there to remind you that a good web application should be data-driven. My project is to help direct new users towards this goal, while still preserving an agnostic framework.

Re: [web2py] Re: Design flaw in auth.impersonate ?

2015-04-06 Thread Louis Amon
April 2015 06:51:53 UTC+12, Louis Amon wrote: When you impersonate a user in web2py, your whole auth session gets replaced with the user's, and that means you lose access to whatever permissions you used to have (http://web2py.readthedocs.org/en/latest/tools.html#gluon.tools.Auth.impersonate

Re: [web2py] Re: Design flaw in auth.impersonate ?

2015-04-06 Thread Louis Amon
Usually I would agree with you guys : browsers can manage separate sessions perfectly well… but we are all devs here so we have a bias. Imagine you have -10 years of computer knowledge, and that you’re on the phone with a customer and have to check data on your platform by impersonating him.

[web2py] Design flaw in auth.impersonate ?

2015-04-05 Thread Louis Amon
When you impersonate a user in web2py, your whole auth session gets replaced with the user's, and that means you lose access to whatever permissions you used to have ( http://web2py.readthedocs.org/en/latest/tools.html#gluon.tools.Auth.impersonate ) Practically : if you're a staff member

[web2py] Re: Difference between response.files.insert() and URL(), and congratulations on v2.10

2015-04-05 Thread Louis Amon
Unless... you have response.optimize_css set somewhere in your code as well. In which case, some pre-processing and caching would be applied to your CSS file before it is injected in the view. More doc here : http://www.web2py.com/books/default/chapter/29/04/the-core#response On Thursday,

Re: [web2py] Drill-down menu with PostgreSQL

2015-04-05 Thread Louis Amon
huge to compute, read often, modified rarely...can be computed rarely and stored somewhere with the most correct structure that is read-safe. On Thursday, February 12, 2015 at 1:27:29 PM UTC+1, Louis Amon wrote: a webpage holding 200 locations and requiring 800 queries is not a webpage a user

[web2py] Re: Project: Heroku Buildpack for Web2py

2015-04-05 Thread Louis Amon
After much thought, and based on the fact that I've been using the Heroku/Web2py stack for more than a year now, I think I'll try to build a scaffolding app dedicated to Heroku in order to demonstrate exactly how one should go about building a web2py-based application on a PaaS cloud with no

[web2py] StackShare

2015-04-02 Thread Louis Amon
Just pointing out that web2py should be on StackShare http://stackshare.io/, same as Django and other frameworks. It's not really my place to build web2py's vendor profile http://stackshare.io/vendors# so I'll leave that to it's founders (@MassimoDiPierro) I'm using it (as text for now,

Re: [web2py] Project: Heroku Buildpack for Web2py

2015-03-14 Thread Louis Amon
:-) I would be great if you could share it. Sure! The logic I ended up using for Heroku is more explicit than gluon/contrib/heroku.py, and closer to how the doc handles GAE : import os detect_heroku = lambda: bool([n for n in os.environ.keys() if n[:18]+n[-4 :]=='HEROKU_POSTGRESQL__URL'])

Re: [web2py] Project: Heroku Buildpack for Web2py

2015-03-14 Thread Louis Amon
migrations at once but all need the correct .table files. I do not have a simple answer. Make sure you look into gluon/contrib/heroku.py On Thursday, 12 March 2015 09:02:54 UTC-5, Louis Amon wrote: I'm trying to create a Buildpack designed specifically for deploying Web2py-based applications

Re: [web2py] Re: Compute insert-only

2015-03-12 Thread Louis Amon
insert instead of after: db.mytable._before_insert.append(lambda fields: fields.update(url=make_url(fields))) Anthony On Tuesday, March 10, 2015 at 12:10:12 PM UTC-4, Niphlod wrote: code an _after_insert callback. On Tuesday, March 10, 2015 at 4:21:26 PM UTC+1, Louis Amon wrote: I'm

[web2py] Project: Heroku Buildpack for Web2py

2015-03-12 Thread Louis Amon
I'm trying to create a Buildpack designed specifically for deploying Web2py-based applications on Heroku. Buildpacks are shell programs that are used to build deploy slugs on Heroku. The buildpack runs *before* the web2py application is launched. It is basically a kind of deploy hook. The

Re: [web2py] Compute insert-only

2015-03-12 Thread Louis Amon
That’d do the trick nicely. Thanks Niphlod! Le 10 mars 2015 à 17:10, Niphlod niph...@gmail.com a écrit : code an _after_insert callback. On Tuesday, March 10, 2015 at 4:21:26 PM UTC+1, Louis Amon wrote: I'm trying to hard-code URLs for SEO purposes so I have a function (make_url(row

[web2py] Compute insert-only

2015-03-10 Thread Louis Amon
I'm trying to hard-code URLs for SEO purposes so I have a function (make_url(row)) that builds the paths based on other fields. I was thinking of using compute=make_url, but it seems that update operations also call the compute. Is there a way to use compute only on INSERT operations, and not

Re: [web2py] Routes pattern and args / query strings

2015-02-26 Thread Louis Amon
, February 25, 2015 at 7:54:36 AM UTC-5, Louis Amon wrote: Anyway, the rules are processed in order, so you should be able to include a rule mapping static to static, and then include the /s$anything rule (which won't be matched to static because the static rule will already have matched

Re: [web2py] Routes pattern and args / query strings

2015-02-25 Thread Louis Amon
to static because the static rule will already have matched). Anthony On Wednesday, February 25, 2015 at 6:18:02 AM UTC-5, Louis Amon wrote: I'm opening this thread to discuss pattern-based routing and especially the handling of args and vars in an incoming URL. Based on the doc, you

Re: [web2py] Query string lost when redirecting through routes.py

2015-02-25 Thread Louis Amon
, Anthony abasta...@gmail.com a écrit : You need to match and copy the query string explicitly: ('/annonces$query', '301-/s$query') On Wednesday, February 25, 2015 at 6:00:09 AM UTC-5, Louis Amon wrote: Hello, I'm trying to map this URL : localhost:8000/annonces?lat=48.8610181lng

[web2py] Query string lost when redirecting through routes.py

2015-02-25 Thread Louis Amon
Hello, I'm trying to map this URL : localhost:8000/annonces?lat=48.8610181lng=2.3140934locality=Paris To this : localhost:8000/s/paris (Full-text search hurrayyy) I'm using the pattern-based routes.py to do that : routes_in =[... ('/annonces', '301-/s'), ] But when I try to

[web2py] Routes pattern and args / query strings

2015-02-25 Thread Louis Amon
I'm opening this thread to discuss pattern-based routing and especially the handling of args and vars in an incoming URL. Based on the doc, you can use a simplified syntax in pattern-based routes to avoid struggling with regular expressions: ('/new_name/$anything',

Re: [web2py] Drill-down menu with PostgreSQL

2015-02-12 Thread Louis Amon
I haven’t timed the queries but there’s way more than 4 queries to be done. For instance if I build a drill-down to zoom in on my city (Bordeaux), I would need to build something like this : Aquitaine (administrative_area_level_1) Gironde (administrative_area_level_2) Bordeaux (locality)

Re: [web2py] Drill-down menu with PostgreSQL

2015-02-12 Thread Louis Amon
a webpage holding 200 locations and requiring 800 queries is not a webpage a user would need. That’s actually a very good point ! This page is actually designed for SEO, but even SEO doesn’t go well with hundreds of links. I think I should build a navigation architecture that maps the

[web2py] Drill-down menu with PostgreSQL

2015-02-11 Thread Louis Amon
I am trying to build a geo-based drill-down sitemap for my website, pretty much like this https://www.airbnb.com/sitemaps/western-europe?locale=en What I have is a model with the following fields: administrative_area_level_1 administrative_area_level_2 locality sublocality_level_1 I could loop

[web2py] Re: Memory leaks in web2py : how do you track them ?

2015-02-01 Thread Louis Amon
Update: I've tried running 2 dynos to see if splitting traffic in two would reduce the slope of my memory leak, and also to see if the garbage collector would somehow work better. It seems not : 2015-02-01T09:23:50.049734+00:00 heroku[web.1]: *source**=web.1* dyno=heroku

[web2py] Memory leaks in web2py : how do you track them ?

2015-02-01 Thread Louis Amon
I have a web2py server running on heroku. So far my server had little traffic, and Heroku being a cloud PaaS service means they put processes to sleep if they're not used for a while. Because of that, I never really noticed that the memory signature of my application was growing at every

[web2py] Re: Memory leaks in web2py : how do you track them ?

2015-02-01 Thread Louis Amon
Udate 2: I've tried switching from the Rocket server to Gunicorn : the memory's still increasing and quotas are reached in a matter of hours. BTW I'm running web2py version 2.9.11. Has the new patch fixed anything that might help with memory leaks ? Should I try updating my server ? --

Re: [web2py] Re: Memory leaks in web2py : how do you track them ?

2015-02-01 Thread Louis Amon
No I do not have pool_size defined. Can it help ? From: Leonel Câmara Sent: ‎Sunday‎, ‎1‎ ‎February‎ ‎2015 ‎16‎:‎26 To: web2py@googlegroups.com Do you have pool_size defined? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py

Re: [web2py] Re: Rocket // HTTP 400 Bad Request - Body is incomplete

2015-01-13 Thread Louis Amon
12:56:54 AM UTC+1, Louis Amon wrote: I've tested the native error handler (working fine) versus my custom error handler (generating HTTP 400 error + web2py stuck) : The main difference between the two is that the native error handler doesn't generate an additional request while routes_onerror

Re: [web2py] lazy tables auth_event

2015-01-12 Thread Louis Amon
to reproduce the issue? Paolo On Sunday, January 11, 2015 at 10:54:26 PM UTC+1, Louis Amon wrote: Hello, I'm trying to optimize the performance of my website by using lazy tables. When I do so, every feature linked with Auth breaks with the following error msg : ProgrammingError: ('ERROR

[web2py] lazy tables auth_event

2015-01-11 Thread Louis Amon
Hello, I'm trying to optimize the performance of my website by using lazy tables. When I do so, every feature linked with Auth breaks with the following error msg : ProgrammingError: ('ERROR', '42703', 'column created_on of relation auth_event does not exist') I think it is due to the

Re: [web2py] Re: Rocket // HTTP 400 Bad Request - Body is incomplete

2015-01-03 Thread Louis Amon
I've tested the native error handler (working fine) versus my custom error handler (generating HTTP 400 error + web2py stuck) : The main difference between the two is that the native error handler doesn't generate an additional request while routes_onerror seems to generate an additional

Re: [web2py] Re: Rocket // HTTP 400 Bad Request - Body is incomplete

2014-12-29 Thread Louis Amon
/location/index/espace-de-stockage/la-seyne-sur-mer/1 copystream called with size=672 /error/ticket/index/ copystream called with size=672 class 'socket.timeout' timed out /error/ticket/index/ copystream called with size=672 class 'socket.timeout' timed out /error/ticket/index/

Re: [web2py] Re: Rocket // HTTP 400 Bad Request - Body is incomplete

2014-12-29 Thread Louis Amon
This is the request received by my ticket handler (I removed some big chunks so that it's readable): _vars None function index _body None args [] wsgi gluon.main.LazyWSGI object at 0x111e5cdd0 controller ticket utcnow 2014-12-29 18:09:42.485011 url /error/ticket/index/ step None now

[web2py] Rocket // HTTP 400 Bad Request - Body is incomplete

2014-12-27 Thread Louis Amon
I made some changes to my code and it seems I broke some stuff. Problem is : instead of getting a ticket, my POST request is stalled and my console is displaying this error : ERROR - 27-12-2014 17:16:27 - Rocket.Errors.Thread-10 : Traceback (most recent call last): File

Re: [web2py] Re: Rocket // HTTP 400 Bad Request - Body is incomplete

2014-12-27 Thread Louis Amon
If it’s easy to debug then how do I proceed ? :) I’ve copied here the request headers from Google Chrome : Request URL:http://localhost:8000/location/index/espace-de-stockage/la-seyne-sur-mer/1 Request Headers Provisional headers are shown

Re: [web2py] Re: Sticky sessions in a distributed environment

2014-12-04 Thread Louis Amon
Note, aside from adding a few lines in the admin app to have its sessions stored in the db, another option might be to edit the handler file used to start web2py. In that file, you should be able to do something like this: from gluon.settings import global_settings

Re: [web2py] Re: Sticky sessions in a distributed environment

2014-12-04 Thread Louis Amon
I'm not too familiar with Heroku, but according to the little documentation I have seen, the filesystem should persist until the dyno restarts or is shut down. Does it really just reset randomly? In theory you would be correct. The doc says that it resets on restarts or upon stopping a

Re: [web2py] Re: Sticky sessions in a distributed environment

2014-11-28 Thread Louis Amon
Right. Then why does the whole ticketting system depend on admin ? It is even said in the Deployment Recipe chapter of the doc http://www.web2py.com/books/default/chapter/29/13/deployment-recipes#Collecting-tickets : You can later view the errors *using the admin app*, clicking on the switch

[web2py] Re: Sticky sessions in a distributed environment

2014-11-28 Thread Louis Amon
I don't think commenting about my age is any more mature than what you claim I would be... Anyway, contributing is amongst my current preoccupations - as I mentionned in another post. The thing is : my disappointment here lies in the architecture, not the features. There is little

Re: [web2py] Re: Sticky sessions in a distributed environment

2014-11-26 Thread Louis Amon
Ok I think I found where the problem lies: In applications/admin/models/access.py we have this structure: if request.env.web2py_runtime_gae: session_db = DAL('gae') session.connect(request, response, db=session_db) hosts = (http_host, ) is_gae = True else: is_gae = False

Re: [web2py] Re: Sticky sessions in a distributed environment

2014-11-26 Thread Louis Amon
I can’t find any documentation about settings.cfg. How does it work ? Where is it loaded ? Is it application-specific ? I’m not sure setting a connection string in a file is the way to go with Heroku : you don’t really have those (they are dynamically generated). When you create a db in Heroku

Re: [web2py] Re: Sticky sessions in a distributed environment

2014-11-26 Thread Louis Amon
, November 26, 2014 8:34:58 AM UTC-5, Louis Amon wrote: I can’t find any documentation about settings.cfg. How does it work ? Where is it loaded ? Is it application-specific ? settings.cfg is in /web2py/applications/admin/ and is specific to the admin app. Currently it only holds editor settings

Re: [web2py] Re: Sticky sessions in a distributed environment

2014-11-25 Thread Louis Amon
in the table web2py_session_APPNAME and that is exactly the value of the cookie in found in my browser. On Wednesday, October 29, 2014 5:59:05 PM UTC+1, Louis Amon wrote: I tried to apply Derek’s advice by storing sessions in cookies, same problem : as long as my web app runs on 1 dyno everything

[web2py] Upload path broken since 2.9.11 update

2014-11-13 Thread Louis Amon
Hi, My website has been using web2py for a few months now, and we handle pictures using Amazon S3 and Cloudfront for storage and distribution. The corresponding code in web2py looks like this : Field('picture_1', type='upload', requires=IS_EMPTY_OR(IS_IMAGE(extensions=('jpeg',

Re: [web2py] Upload path broken since 2.9.11 update

2014-11-13 Thread Louis Amon
:12, Anthony abasta...@gmail.com a écrit : Which version of web2py were you using prior to the upgrade? On Thursday, November 13, 2014 4:04:19 AM UTC-5, Louis Amon wrote: Hi, My website has been using web2py for a few months now, and we handle pictures using Amazon S3 and Cloudfront

Re: [web2py] Upload path broken since 2.9.11 update

2014-11-13 Thread Louis Amon
I really don’t have any time to setup my environment for proper testing git contributions. I still consider myself to be a novice and I’m the only dev in my startup right now… But I do intend to contribute to the framework in a few weeks’ time, when my startup will have raised funds :) Le

Re: [web2py] Re: Sticky sessions in a distributed environment

2014-10-29 Thread Louis Amon
they are limited in size. Large sessions will result in broken cookies. On Friday, October 24, 2014 2:41:06 AM UTC-7, Louis Amon wrote: I am trying to scale up my application deployed on Heroku by increasing the number of dynos and am currently confronted with the issue of handling sessions

[web2py] Sticky sessions in a distributed environment

2014-10-24 Thread Louis Amon
I am trying to scale up my application deployed on Heroku by increasing the number of dynos and am currently confronted with the issue of handling sessions in a distributed environment. The regular solution (storing sessions in the database) does not seem to work anymore when multiple dynos

Re: [web2py] Sticky sessions in a distributed environment

2014-10-24 Thread Louis Amon
/articles/java-faq quote The Heroku routing infrastructure does not support sticky sessions. Requests from clients will be distributed randomly to all dynos running your application. /quote On Friday, 24 October 2014 04:41:06 UTC-5, Louis Amon wrote: I am trying to scale up my application

[web2py] Heroku: multiple dynos using Web2py

2014-10-01 Thread Louis Amon
I noticed a pretty nasty glitch while scaling my production server today : The implementation of close_connection() in dal.py doesn't work well with multiple dynos in a cloud hosting solution. Here's the code I have, runnint web2py 2.9.5 : def close_connection(self): if self.db is

[web2py] SQLFORM.grid links and inner join

2014-08-28 Thread Louis Amon
I have a simple one-to-many relation like so: db.define_table('person', Field('job')) db.define_table('thing', Field('owner_id', 'reference person')) And I built a grid using SQLFORM.grid like so: grid = SQLFORM.grid((db.person.id == db.thing.owner_id),

[web2py] Re: SQLFORM.grid links and inner join

2014-08-28 Thread Louis Amon
. On Thursday, August 28, 2014 5:04:36 PM UTC+2, Louis Amon wrote: I have a simple one-to-many relation like so: db.define_table('person', Field('job')) db.define_table('thing', Field('owner_id', 'reference person')) And I built a grid using SQLFORM.grid like so: grid = SQLFORM.grid

[web2py] Delegated validation in an SQLFORM

2014-08-27 Thread Louis Amon
I'm trying to build a form based on Google Places (geocoding) based on the following table: db.define_table('place', Field('address'), Field('street_number'), Field('route'), Field('locality'), Field('lat'),

[web2py] Re: Delegated validation in an SQLFORM

2014-08-27 Thread Louis Amon
? On Wednesday, August 27, 2014 12:08:46 PM UTC+2, Niphlod wrote: use an onvalidate call that do the checks on lat and lng but adds the error on address. On Wednesday, August 27, 2014 11:50:42 AM UTC+2, Louis Amon wrote: I'm trying to build a form based on Google Places (geocoding) based

[web2py] What is the right way to serve static files through a CDN ?

2014-08-13 Thread Louis Amon
I am using a CDN and am trying to configure web2py to use it instead of the classic static file service. So far I've been using pattern-based routes like this : cdn = 'https://xxx.cloudfront.net' routes_in = (... ('/static/$anything', cdn + '/static/$anything'),

Re: [web2py] Re: web2py on heroku getting InternalError: current transaction is aborted... Ticket

2014-08-06 Thread Louis Amon
Got the same issue as well. Apparently the problem has to do with the UseDatabaseStoredFile class inherited by the HerokuPostgresAdapter. It is designed to store the filesystem (databases folder and files) in a table instead, and was created for GAE but doesn't seem to work on Heroku. That's

[web2py] Re: Problem with web2py on Heroku

2014-08-04 Thread Louis Amon
Has anyone found a solution to this ? I just tried deploying on Heroku today and had the exact same problem. Heroku logs : 2014-08-04T19:12:36.276606+00:00 app[web.1]: File /app/gluon/dal.py, line 4560, in exists 2014-08-04T19:12:36.276608+00:00 app[web.1]: if db.executesql(query):

[web2py] Re: Bootstrap MENU (li_class)

2014-07-28 Thread Louis Amon
)),] On Thursday, 24 July 2014 12:26:51 UTC-5, Louis Amon wrote: I'm trying to build a MENU styled with Boostrap. I'd like my li items to have the class btn. How can I do that in web2py ?? As far as I know, li_class is only applied on submenus, but not on primary menu items

[web2py] Password fields fine tuning

2014-07-25 Thread Louis Amon
I'm trying to improve user exprerience on my website and I noticed a rather annoying behavior on password fields : If I type a password longer than 8 characters and somehow my form fails (some other field didn't validate), my password gets replaced by in request.vars.password. For

Re: [web2py] Password fields fine tuning

2014-07-25 Thread Louis Amon
think ? Le 25 juil. 2014 à 14:47, Niphlod niph...@gmail.com a écrit : so you really want the webpage to return the actual password instead of asterisks ? it's a big security risk, no matter what user experience says. On Friday, July 25, 2014 10:53:40 AM UTC+2, Louis Amon wrote: I'm

Re: [web2py] Password fields fine tuning

2014-07-25 Thread Louis Amon
a écrit : A simple google search will yield people complaining about their host accounts getting hacked on airbnb. Just because someone or something large 'does it that way' doesn't mean it's a best practice! On Friday, July 25, 2014 9:08:00 AM UTC-4, Louis Amon wrote: I don't see much

Re: [web2py] Password fields fine tuning

2014-07-25 Thread Louis Amon
, and I only have to correct the second password, not re-enter the first. Can you show the code you are using for your forms? Anthony On Friday, July 25, 2014 9:32:03 AM UTC-4, Louis Amon wrote: We're all developers here so I couldn't agree more. Still, I'm running a commercial website so

Re: [web2py] Password fields fine tuning

2014-07-25 Thread Louis Amon
, Louis Amon wrote: @Anthony: Indeed, I forgot to add that I’m using auth forms through ajax via LOAD. The problem may be due to ajax's JSON conversion of request.vars. Le 25 juil. 2014 à 15:52, Anthony abas...@gmail.com javascript: a écrit : I think common practice is to leave password

Re: [web2py] Password fields fine tuning

2014-07-25 Thread Louis Amon
=login_password, _class=input-basic input-200) Anthony On Friday, July 25, 2014 10:35:18 AM UTC-4, Louis Amon wrote: After much research I found the trigger to replicate the issue : db.auth_user.password.widget = lambda k,v: SQLFORM.widgets.password. widget(k, v, _id=login_password, _class=input

[web2py] Bootstrap MENU (li_class)

2014-07-24 Thread Louis Amon
I'm trying to build a MENU styled with Boostrap. I'd like my li items to have the class btn. How can I do that in 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

[web2py] User_agent in a LOADed view

2014-07-16 Thread Louis Amon
I'm a great fan of LOAD, and i'm using it quite a bit to generate cool ajax pages. I got one issue so far though : can't seem to *cleanly* detect a mobile device in a .load view. For example I have a result.load view and I want a special mobile display in result.mobile.load. I've tried to

[web2py] Re: User_agent in a LOADed view

2014-07-16 Thread Louis Amon
{{ is_mobile = request.user_agent().is_mobile }} TypeError: 'NoneType' object is not callable On Wednesday, July 16, 2014 10:48:23 PM UTC+2, Anthony wrote: Please show your code and the exception. On Wednesday, July 16, 2014 4:15:27 PM UTC-4, Louis Amon wrote: I'm a great fan of LOAD

[web2py] Re: Strange problem importing a module

2014-07-15 Thread Louis Amon
I'm having a very similar issue : If I do : from geocoder import api it works fine but if I do : from plugin_geocomplete.geocoder import api then the api.py module isn't detected by gluon custom importer It's the exact same package but changing the namespace provides different results. In

[web2py] Re: Alternative IDEs?

2014-07-15 Thread Louis Amon
I've been curious about Ninja IDE for a few months now, care to elaborate ? Is web2py as well-integrated as Django now ? Can it display web2py-rendered web page in the IDE ? Last time I tried Ninja IDE I was very disappointed because the announced features were far from complete. On Tuesday,

[web2py] Enhancement : show_if in SQLFORM.factory

2014-07-12 Thread Louis Amon
Not sure if somebody noticed before, but the show_if syntax (backed by web2py.js) is actually breaking if you use SQLFORM.factory to generate your form. Example: db.define_table('person', Field('name', 'string'), Field('show_trigger', 'boolean')) db.person.name.show_if =

[web2py] Hidden fields: a more complete approach

2014-07-12 Thread Louis Amon
I want a hidden input with a custom attribute (e.g.: data-geo) to be stored in the database upon form validation. input name=latitude data-geo=lat style=display:none How can I achieve this ? 1. Adding raw html to a custom form, although custom forms have a lot of drawbacks in web2py

[web2py] Re: Enhancement : show_if in SQLFORM.factory

2014-07-12 Thread Louis Amon
wrote: Instead, you can just do this: form = SQLFORM.factory(db.person, table_name='person') Anthony On Saturday, July 12, 2014 2:02:45 PM UTC-4, Louis Amon wrote: Not sure if somebody noticed before, but the show_if syntax (backed by web2py.js) is actually breaking if you use

[web2py] Improvement: Adding component modules to environment

2014-07-09 Thread Louis Amon
Say you want to develop and distribute a plugin, and that this plugin relies on a third-party module or package. For the example, we'll say the third-party is matplotlib. In order to distribute your plugin, you'd need give instructions so that your plugin's users install matplotlib either in

[web2py] Show_if not working in custom forms

2014-06-20 Thread Louis Amon
Conditional fields are a great asset to web2py. Sadly, it seems to only work if you use SQLFORM's render, not with form.custom ! I've made several tests and for the same form defined in the controller model, my view looks like: {{ extend layout.html }} {{ =form }} {{ =form.custom.begin }}

[web2py] Re: multiple models in a plugin component

2014-06-13 Thread Louis Amon
') On Wednesday, June 11, 2014 5:43:29 PM UTC+2, Louis Amon wrote: I found an answer to my own question : I split my model (plugin_name.py) into multiple files (0_settings.py, 1_user.py, etc.) and put them all in a folder ./models/plugin_name/ Web2py does detect that all my model files belong

[web2py] Re: multiple models in a plugin component

2014-06-11 Thread Louis Amon
if a web2py guru happens to read this thread I would appreciate any tip he could provide to face this issue ! On Friday, May 23, 2014 2:06:42 PM UTC+2, Louis Amon wrote: I am trying to build a big 'plugin component', with a plugin manager and therefore using the full naming conventions specified

Re: [web2py] Re: Form validators: IS_IN_DB(..., _or=other_validator) ?

2014-05-25 Thread Louis Amon
table or record #5 in the watermelon table. Anthony On Friday, May 23, 2014 5:24:49 PM UTC-4, Louis Amon wrote: Well in this particular case I needn't know wether I'm storing a melon or a watermelon's id. I know it's kind of idiotic but I just need a 'fruit' id. Think

[web2py] Record representation : multiple levels of references

2014-05-23 Thread Louis Amon
Say I have a table like this: db.define_table('person', Field('first_name'), Field('last_name'), format='%(first_name)s %(last_name)s' Now if I build a new table: db.define_table('key', Field('person_id', 'reference person', requires=IS_IN_DB(db, db.person, label=db.person._format))) My new

[web2py] multiple models in a plugin component

2014-05-23 Thread Louis Amon
I am trying to build a big 'plugin component', with a plugin manager and therefore using the full naming conventions specified in the doc. My model is starting to be huge (1000+ lines) and I'm trying to split it into multiple files. Is there a way to name these files so that web2py still

[web2py] Re: Record representation : multiple levels of references

2014-05-23 Thread Louis Amon
, r. person_id.last_name, r.id Anthony On Friday, May 23, 2014 5:38:21 AM UTC-4, Louis Amon wrote: Say I have a table like this: db.define_table('person', Field('first_name'), Field('last_name'), format='%(first_name)s %(last_name)s

[web2py] Form validators: IS_IN_DB(..., _or=other_validator) ?

2014-05-23 Thread Louis Amon
Due to external constraints, I need to define two tables that are actually siblings and a third table's field that can choose from any of said tables. e.g.: db.define_table('melon') db.define_table('watermelon') I need the third table's field to be a reference to either of the two first

Re: [web2py] Re: Form validators: IS_IN_DB(..., _or=other_validator) ?

2014-05-23 Thread Louis Amon
data about every transaction my program does with this poorly-designed API Le 23 mai 2014 à 23:03, Anthony abasta...@gmail.com a écrit : How would you know whether the field stores an id of the melon table or the watermelon table? On Friday, May 23, 2014 4:52:58 PM UTC-4, Louis Amon wrote

Re: [web2py] Pluralization and styles

2014-05-06 Thread Louis Amon
I made a slight modification (**%s** instead of *%s*) and then it worked ! Thanks On Wednesday, April 30, 2014 6:28:40 PM UTC+2, dbdeveloper wrote: you can try to use markmin in T for styling. You need to write: T.M('*%s* %%{result} %%{found}', symbols=num_offers) 29.04.14 21:28, Louis

[web2py] Pluralization and styles

2014-04-29 Thread Louis Amon
I'm trying to print something like that in my view : *31* results found (notice the bold number) I used the pluralization engine like this: T('%s %%{result} %%{found}', symbols=num_offers) And it gives the right string but obviously not styled. Other attempts: T(XML('strong%s/strong)' + '

Re: [web2py] Login ajax component

2014-04-22 Thread Louis Amon
, April 21, 2014 12:35:56 PM UTC+2, Marin Pranjić wrote: This sounds like a bug. Marin (mobile) On Apr 18, 2014 9:10 PM, Louis Amon moo...@msn.com javascript: wrote: I'm trying to build an Ajax-based login form using web2py's LOAD() helper. I made a controller named 'users.py', in which I

[web2py] Re: Login ajax component

2014-04-21 Thread Louis Amon
) but at least my problem is solved for now. On Thursday, April 17, 2014 8:31:57 PM UTC+2, Louis Amon wrote: I'm trying to build an Ajax-based login form using web2py's LOAD() helper. I made a controller named 'users.py', in which I defined a 'signin()' function : def signin(): form

[web2py] how to use gluon Expose

2014-04-21 Thread Louis Amon
Hi, I'm trying to expose a folder in my application, so I tried to use the Expose function as described herehttp://web2py.com/books/default/chapter/29/14/other-recipes#Publishing-a-folder My controller looks like : from gluon.tools import Expose def presse():

  1   2   >