[web2py] Re: [web2pyy] Mysql 2 Mongodb

2013-07-24 Thread Mike Veltman
On Monday 22 July 2013 05:16:56 Alan Etkin wrote: I am just playing around with mongodb and web2py I noticed that when I just make a web2py dump of my mysql db and then upload it to mongodb some of the "joins" now just rec id's are right and some are newly generated. Also would it be possib

Re: [web2py] Re: web2py book multilanguage

2013-07-24 Thread Massimo Di Pierro
Sorry. Was in the middle of an upgrade. On Tuesday, 23 July 2013 10:05:09 UTC-5, Richard wrote: > > Book is down! > > http://web2py.com/admin/default/ticket/unknown > > > On Tue, Jul 23, 2013 at 10:23 AM, Massimo Di Pierro > > > wrote: > >> Here is the book in Italian (older version): >> https:/

Re: [web2py] online web2py book inaccessible

2013-07-24 Thread Massimo Di Pierro
I was doing an upgrade. Can you confirm everything is ok now? On Tuesday, 23 July 2013 12:15:42 UTC-5, Jonathan Lundell wrote: > > On 23 Jul 2013, at 9:59 AM, David S > > wrote: > > It seems the online web2py book (http://web2py.com/book) isn't working > for me and is giving an unknown error. >

[web2py] Re: Failing to execute python script from the Windows CMD

2013-07-24 Thread Massimo Di Pierro
If you use the binary distribution you do not need "python" and you should call web2py with: > web2py.exe -S myApp - M -R applications/myApp/scripts/myAppScript.py but since you have python installed, you should follow Anthony's advice and run web2py form source. On Tuesday, 23 July 2013 16:5

[web2py] Re: This javascript worked in older version of web2py - not in trunk version.

2013-07-24 Thread Johann Spies
On Wednesday, 24 July 2013 09:54:28 UTC+2, Johann Spies wrote: > > > I have not been able to determine the exact course of the problem. > > It seems that static/js/jquery.js is the problem. Replacing the file in the working app with the one from the Welcome app, breaks things. Regards Johann

[web2py] strange decimal form field comparison result

2013-07-24 Thread 黄祥
hi folks, i have a decimal form field that validate during submit (running on web2py 2.5.1): e.g. on controller def product(): grid=SQLFORM.grid(db.product, onvalidation=__onvalidation_product) return locals() def __onvalidation_product(form): *if form.vars.price_list >= form.vars.s

[web2py] Need Apache help for "uploads" directory

2013-07-24 Thread Joe Barnhart
So a central part of my website is a repository of files/objects that are added and removed. I've chosen to use the "uploads" folder in my application directory, with additional feature of scattering the files into subdirectories (because I expect a LOT of them). I'm trying the stock apache2 s

Re: [web2py] online web2py book inaccessible

2013-07-24 Thread David S
Everything seems to work. Thanks! On Wednesday, July 24, 2013 4:28:38 AM UTC-4, Massimo Di Pierro wrote: > > I was doing an upgrade. Can you confirm everything is ok now? > > On Tuesday, 23 July 2013 12:15:42 UTC-5, Jonathan Lundell wrote: >> >> On 23 Jul 2013, at 9:59 AM, David S wrote: >> >> It

[web2py] How can I protect the entire controller to be available only for logged in users?

2013-07-24 Thread David Marko
How can I protect the entire controller to be available only for logged in users? Something like @auth.requires_login() but for the entire controller instead of each method ? -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe

Re: [web2py] How can I protect the entire controller to be available only for logged in users?

2013-07-24 Thread Marin Pranjić
put the logic on top of controller file: if not auth.is_logged_in(): redirect( ... ) On Wed, Jul 24, 2013 at 1:38 PM, David Marko wrote: > How can I protect the entire controller to be available only for logged in > users? Something like @auth.requires_login() but for the entire controller

[web2py] Re: Need Apache help for "uploads" directory

2013-07-24 Thread dhmorgan
usually this setup makes "www-data" the owner of /var/www/ and everything beneath it, so you'll have to (a) do file operations as root/sudo/administrator, (b) add yourself to www-data group and give write permission to group, or (c) temporarily give yourself ownership and then change it back i

Re: [web2py] What is the import order for model files when using subfolders based on controller names ?

2013-07-24 Thread Vinicius Assef
alphabetical. On Wed, Jul 24, 2013 at 3:59 AM, David Marko wrote: > I'm using model subfolders for specific controllers based on docs here "By > default, this is set automatically to load /a/models/*.py, /a/models/c/*.py, > and /a/models/c/f/*.py files when /a/c/f is requested." What is the impor

[web2py] Inconsisten crud form processing

2013-07-24 Thread w2p user
I'm trying to use the custom CRUD form processing but am getting a strange result. For a simple two field form, the default form of the crud behaves as expected. The custom form doesn't process. Why are they different? Thank you for any help. {{=crud_form}} {{=crud_form.custom.begin}} shif

Re: [web2py] How can I protect the entire controller to be available only for logged in users?

2013-07-24 Thread Anthony
On Wednesday, July 24, 2013 7:56:48 AM UTC-4, Marin Pranjić wrote: > put the logic on top of controller file: > > if not auth.is_logged_in(): > redirect( ... ) > Or if you want to get the automatic redirect and messaging behavior of the @auth.requires_login() decorator, you can use this tric

[web2py] How to use the templating engine as a module

2013-07-24 Thread Eduardo Cruz
Hello, I want to use the templating engine as a module so I can use it with weasyprint as a barebones reporting engine, with mako I can do: from mako.template import Template print Template("hello ${data}!").render(data="world") How could I do that in the web2py templating engine? -- --- Y

[web2py] auth_event logging

2013-07-24 Thread Marin Pranjić
I am using trunk. When I register, login or update profile, auth_event records are not created. Sorry I don't have time to look more into it. Marin -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop

Re: [web2py] How can I protect the entire controller to be available only for logged in users?

2013-07-24 Thread Richard Vézina
Anthony, what the advantage of that over @auth.requires_login() ?? Thanks Richard On Wed, Jul 24, 2013 at 9:36 AM, Anthony wrote: > On Wednesday, July 24, 2013 7:56:48 AM UTC-4, Marin Pranjić wrote: > >> put the logic on top of controller file: >> >> if not auth.is_logged_in(): >> redirec

[web2py][share] ressources

2013-07-24 Thread Richard
Hello, I recently discover these two lib : http://johnny.github.io/jquery-sortable/ (avoid jquery ui just to get drag and drop capability) http://fgnass.github.io/spin.js/ (a spinner lib) :) Richard -- --- You received this message because you are subscribed to the Google Groups "web2py-

Re: [web2py] offtopic : beautiful code

2013-07-24 Thread António Ramos
Also this book just came out. Seems very good http://eu.wiley.com/WileyCDA/WileyTitle/productCd-EHEP002658.html 2013/7/23 Ykä Marjanen > I've watched this at least 10 times. Definately would recommend all web2py > developers to watch and learn from this. > > Ykä > > -- > > --- > You received

[web2py] Why is a uuid string in an upload file name?

2013-07-24 Thread Cliff Kachinske
Storing uploads in the database. The structure of an encoded name for an uploaded file seems to be this: What is the reason for the uuid string? Thanks, Cliff Kachinske -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscrib

[web2py] Link to default value for db table field

2013-07-24 Thread shapovalovdenis
Hi! Let's say I've following table defined: db.define_table('page', Field('is_index', 'boolean'), Field('title', 'text', default=''), Field('block_content', 'text', default=''), Field('block_ad', 'text', default=''), Field('block_footer', 'text', default=''), format='%(title)

Re: [web2py] How can I protect the entire controller to be available only for logged in users?

2013-07-24 Thread Anthony
On Wednesday, July 24, 2013 10:34:22 AM UTC-4, Richard wrote: > Anthony, what the advantage of that over @auth.requires_login() ?? > @auth.requires_login() has to be applied separately to each function you want to protect. David asked about protecting an entire controller. To avoid having to re

Re: [web2py] How can I protect the entire controller to be available only for logged in users?

2013-07-24 Thread Richard Vézina
Ok, Thank you for clarification! Richard On Wed, Jul 24, 2013 at 11:55 AM, Anthony wrote: > On Wednesday, July 24, 2013 10:34:22 AM UTC-4, Richard wrote: > >> Anthony, what the advantage of that over @auth.requires_login() ?? >> > > @auth.requires_login() has to be applied separately to each f

Re: [web2py] Re: This javascript worked in older version of web2py - not in trunk version.

2013-07-24 Thread Richard Vézina
Johann don't forget to update the other files too... https://groups.google.com/d/msg/web2py/tVyL7z7WHkw/mce13Vh-k3UJ Richard On Wed, Jul 24, 2013 at 4:46 AM, Johann Spies wrote: > > > On Wednesday, 24 July 2013 09:54:28 UTC+2, Johann Spies wrote: >> >> >> I have not been able to determine the e

[web2py] discovered something cool in web2py DAL

2013-07-24 Thread VP
Maybe this was obvious, but I never thought I could do this kind of queries in DAL. Okay, let's say I have 2 tables: Tags = db.define_table('tag', Field('name')) Post = db.define_table('post', Field('title'), Field('tag', 'reference tag')) Now, doing a join is easy using the query *(db.post

[web2py] Re: discovered something cool in web2py DAL

2013-07-24 Thread Derek
I believe that example of counting contains is in the book, so to anyone who didn't read the book this is new, however, the example was kind of confusing. I remember reading about it on the newsgroup that someone couldn't understand what was going on. You give a good example of how to rewrite t

[web2py] Behavior Driven Development in Web2Py

2013-07-24 Thread Clarke Bishop
I've been doing the online course, CS169x, from Coursera. The course uses Ruby/Rails, but I like Python better. They picked Rails because they said it was the best for programmer productivity. Maybe once you get way down the learning curve, they are right. However, I find all the Rails "magic"

[web2py] Google Analytics - 'analytics is not defined' error

2013-07-24 Thread stats
Wondering if anyone has seen this. I've set my tracking id in menu.py response.google_analytics_id = 'UA--X' When I load my site, I get js errors: SyntaxError: syntax error http://127.0.0.1:8000/mysite/static/js/analytics.js Line 4 ReferenceError: analytics is not defined http://127.0.

Re: [web2py] Re: [web2pyy] Mysql 2 Mongodb

2013-07-24 Thread Alan Etkin
> Also I concluded that because all the references are replaced by mongodb id's it is not possible to say > dump a table with references in one database and then restore it on mongodb. Neither you can (or should) with other adapters, for example, postgres. Here's section of the book about that

Re: [web2py] Behavior Driven Development in Web2Py

2013-07-24 Thread Richard Vézina
Hello Clarke, There is lettuce : http://net.tutsplus.com/tutorials/python-tutorials/behavior-driven-development-in-python/ Recently Vinicius make an aptempt to make it easier to Unit Test with pytest and web2py : https://groups.google.com/d/msg/web2py/CHfZTr5xHso/lZlGW5tPk6EJ More of unittest,

[web2py] Re: Why is a uuid string in an upload file name?

2013-07-24 Thread Derek
usually so people can have multiple versions of the same file, or so that people with the same name of file don't overwrite each other. On Wednesday, July 24, 2013 8:06:56 AM UTC-7, Cliff Kachinske wrote: > > Storing uploads in the database. > > The structure of an encoded name for an uploaded fi

[web2py] Re: Behavior Driven Development in Web2Py

2013-07-24 Thread Clarke Bishop
Thanks Richard, this is very helpful! Lettuce let me to Behave. http://pythonhosted.org/behave/index.html And, they have a comparison with Lettuce and Freshen, http://pythonhosted.org/behave/comparison.html. I guess I should have thought to do a search for Behavior Driven Development in Python

[web2py] Re: Web2py sem Segredos

2013-07-24 Thread MrEdusi
Legal.. vou assitir! Em terça-feira, 23 de julho de 2013 19h31min29s UTC-3, Ovidio Marinho escreveu: > > As 20:00hs hoje não percam > > https://plus.google.com/events/cocblop80ibv4ou44po12j87i2k > > > > Ovidio Marinho Falcao Neto > ITJP.NET.BR > ovi

[web2py] Web2Py + TurnkeyLinux and Apache

2013-07-24 Thread james c.
I easily deployed my Web2Py app "with just a few clicks" through the TurnKeyLinux Hub onto Amazon EC2. The Web2Py Admin console shows that the app is running with Apache. However, it seems to still be running on Rocket from an error message related to SSL. Any SSL connection attempt is ignored.

Re: [web2py] Re: Behavior Driven Development in Web2Py

2013-07-24 Thread Richard Vézina
If you feel you can hack the Vinicius web2py pytest app to embed a python BDD tool feel free to clone the repo and publish your improvement here!! :) Richard On Wed, Jul 24, 2013 at 3:41 PM, Clarke Bishop wrote: > Thanks Richard, this is very helpful! > > Lettuce let me to Behave. http://pytho

[web2py] Re: Google Analytics - 'analytics is not defined' error

2013-07-24 Thread Paolo Valleri
You found an issue, in the welcome app the analytics library is shiped as minified, given that the correct file name is analytics.min.jsinstead of analytics.js

Re: [web2py][share] ressources

2013-07-24 Thread Paolo Valleri
On Wednesday, July 24, 2013 4:47:37 PM UTC+2, Richard wrote: > > Hello, > > I recently discover these two lib : > > http://johnny.github.io/jquery-sortable/ (avoid jquery ui just to get > drag and drop capability) > thanks for sharing, I would try to use that with bootstrap tabs. > > http://

[web2py] Re: How to use the templating engine as a module

2013-07-24 Thread Massimo Di Pierro
from gluon.template import render print render("hello {{=data}}",context=dict(data="world")) help(render) # for more info Notice that gluon/template.py is a single file with no dependencies. On Wednesday, 24 July 2013 15:45:34 UTC+2, Eduardo Cruz wrote: > > Hello, I want to use the templating e

[web2py] Multi column constraint

2013-07-24 Thread msaronw
I am trying to use the method posted by http://stackoverflow.com/questions/8054665/multi-column-unique-constraint-with-web2py db.define_table('ts_customer', Field('customer_name', 'string', length=80, required=True, unique=True)) db.define_table('ts_mileage_rate',

Re: [web2py] Multi column constraint

2013-07-24 Thread Richard Vézina
Your code seem ok, maybe traceback could help... Or you can look at the line poited by the traceback... Maybe you forgot "db." somewhere in front of ts_mileage_rate Can't say from you code, because it seems ok there. I thought it was caused by the IS_NOT_IN_DB at first but I don't think so. Good

[web2py] www.web2py.com link does not resolve - is site down?

2013-07-24 Thread Rob Paire
When I browse to www.web2py.com in chrome I get a page which says: 502 bad gateway, I tried this from two different connections. PythonAnywhere.com seems to resolve correctly. -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe

Re: [web2py] Re: Behavior Driven Development in Web2Py

2013-07-24 Thread Niphlod
https://github.com/niphlod/welcome_augmented PS: integrating tests for apps (both with py.test or behave) is on the todo-list. On Wednesday, July 24, 2013 10:17:56 PM UTC+2, Richard wrote: > > If you feel you can hack the Vinicius web2py pytest app to embed a python > BDD tool feel free to clon

[web2py] Re: Multi column constraint

2013-07-24 Thread Anthony
Answered on SO: http://stackoverflow.com/a/17845372/440323 On Wednesday, July 24, 2013 5:03:19 PM UTC-4, msa...@gmail.com wrote: > > I am trying to use the method posted by > http://stackoverflow.com/questions/8054665/multi-column-unique-constraint-with-web2py > > db.define_table('ts_custome

[web2py] Re: Err 24: too many files open

2013-07-24 Thread Niphlod
it's a problem on the layers "at the base" of web2py, such as the os, nginx or uwsgi. http://www.cyberciti.biz/faq/linux-unix-nginx-too-many-open-files/ let's see if @roberto (the developer behind uwsgi) passes by with some useful tips too. On Wednesday, July 24, 2013 4:30:51 PM UTC+2, dederock

[web2py] Re: Need Apache help for "uploads" directory

2013-07-24 Thread Niphlod
there are no special permissions because apache can't serve the uploads directory by itself. Remember that "uploads" is not the same as "static". The uploads are interely managed by web2py. On Wednesday, July 24, 2013 11:51:05 AM UTC+2, Joe Barnhart wrote: > > So a central part of my website is

[web2py] Re: Multi column constraint

2013-07-24 Thread villas
Did you try the 'requires' separately, eg db.define_table('ts_mileage_rate', Field('customer_id', 'reference ts_customer', required=True, notnull=True), Field('mileage_rate_year', 'integer', required=True, notnull=True)) db.ts_mileage_rate.mileage_rate_year.requ

[web2py] Re: web2py resources

2013-07-24 Thread Niphlod
another resource: web2py's roadmap : https://trello.com/b/d3aqBbBl/web2py-roadmap -- --- 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...@googl

Re: [web2py] www.web2py.com link does not resolve - is site down?

2013-07-24 Thread Ovidio Marinho
No www.web2py.com olny web2py.com ok Ovidio Marinho Falcao Neto ITJP.NET.BR ovidio...@gmail.com 83 8826 9088 - Oi 83 9336 3782 - Claro Brasil 2013/7/24 Rob Paire > When I browse to www.web2p

[web2py] Re: Need Apache help for "uploads" directory

2013-07-24 Thread Joe Barnhart
Well it's entirely possible I don't understand my problem. Running on my macbook locally everything works like a charm. On the "play" deployment server, which uses Apache, the script that deletes files after processing fails because it lacks "permission" (according to the web2py error log). A

Re: [web2py] Re: Minify (compress) response HTML

2013-07-24 Thread Elcimar
Hmm... Go to listacaiu.com and view source code of the main page.. -- --- 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

[web2py] sqlform.factory multiple requires problem

2013-07-24 Thread Antonis Konstantinos Tzorvas
form = SQLFORM.factory(Field('station', requires=IS_IN_DB(db, 'station.name'), default=request.args(0)), Field('start', requires=[IS_NOT_EMPTY(), IS_IN_DB(db, 'data.year')], default=start), Field('end', requires=IS_NOT_EMPTY(), default=end))

[web2py] Re: sqlform.factory multiple requires problem

2013-07-24 Thread André Kablu
If you use IS_IN_DB it will automatically check if is not empty. The function IS_IN_DB, if used inside list brackets [IS_IN_DB(...,...)] will not show the dropdown. This is the correct behavior. Em quarta-feira, 24 de julho de 2013 20h19min18s UTC-3, Antonis Konstantinos Tzorvas escreveu: > >

Re: [web2py] Re: [web2pyy] Mysql 2 Mongodb

2013-07-24 Thread Mike Veltman
On Wednesday 24 July 2013 11:52:36 Alan Etkin wrote: > Also I concluded that because all the references are replaced by mongodb id's > it is not possible to say > dump a table with references in one database and > then restore it on mongodb. Neither you can (or should) with other adapters, for

Re: [web2py] Re: [web2pyy] Mysql 2 Mongodb

2013-07-24 Thread Alan Etkin
Note: If you are restoring data with the DAL method import_from_csv_file (not the Table class method) using id_map={}, which is the method that should be used to keep references in sync, you should not have issues keeping reference values. I have tested it with a trivial db (a few records and

Re: [web2py] Re: Behavior Driven Development in Web2Py

2013-07-24 Thread Vinicius Assef
+1 :-) On Wed, Jul 24, 2013 at 5:17 PM, Richard Vézina wrote: > If you feel you can hack the Vinicius web2py pytest app to embed a python > BDD tool feel free to clone the repo and publish your improvement here!! > > :) > > Richard > > > On Wed, Jul 24, 2013 at 3:41 PM, Clarke Bishop > wrote: >>

Re: [web2py] Re: Minify (compress) response HTML

2013-07-24 Thread Kernc
On Thu, Jul 25, 2013 at 1:15 AM, Elcimar wrote: > Hmm... Go to listacaiu.com and view source code of the main page.. Oh, yes, of course! Single-line comments need to be skipped too. Will provide a patch ASAP. Thanks. :-) -- --- You received this message because you are subscribed to the Goo

[web2py] Appending for validation using jQuery.

2013-07-24 Thread Prasad Muley
Hello All, I am newbie web2py programmer. I tried to do custom validation using jQuery but not gettng expected result. Code is as followed: *Model-db.py* db.define_table('taxpayer', Field('name'), Field('married','boolean'), Field('spo

Re: [web2py] www.web2py.com link does not resolve - is site down?

2013-07-24 Thread Massimo Di Pierro
Strange. They are the same app and same server, just different processes. They all seem to be up now. One issue I have discovered is that pythonanywhere ignores regex in static files in config and therefore it lets web2py serve static files. Some static files are large and this cause processes t

[web2py] Re: Err 24: too many files open

2013-07-24 Thread dederocks
Thanks a lot for the link. Unfortunately it didn't help. @roberto: the uwsgi process is then indeed eating all the CPU - but I'm not sure it means uwsgi is the culprit, at least at this stage (could be the case earlier though). Is there in linux a way to know who opened which file and when? lsof

[web2py] Re: Need Apache help for "uploads" directory

2013-07-24 Thread Niphlod
just ensure that the user running apache has rw permissions on the web2py root dir, epsecially the uploads one. Il giorno giovedì 25 luglio 2013 00:48:12 UTC+2, Joe Barnhart ha scritto: > > Well it's entirely possible I don't understand my problem. > > Running on my macbook locally everything wor

[web2py] Re: Err 24: too many files open

2013-07-24 Thread Paolo Valleri
dederocks, I've just tried to run lsof -p on a ubuntu server running web2py In my case, it returns 138 opened files among libraries, sockets and so on; the most opened file is /dev/zero, opened 55 times. Paolo On Thursday, July 25, 2013 8:18:32 AM UTC+2, dederocks wrote: > > Thanks a lot for

[web2py] Re: Link to default value for db table field

2013-07-24 Thread shapovalovdenis
sorry to bump it up. But still looking for a simple way to avoid keeping the same values in fields, there should be some way similar to symlinks, no? -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop

[web2py] Re: Err 24: too many files open

2013-07-24 Thread dederocks
Thank you Paolo for the benchmark! In my case, I start at 107, and at the end of the process the count is at 672!! nginx on the other hand is stable around 55. And the culprit is (drums ...): redis! The large majority of the files opened are the redis port. Extract from lsof: uwsgi 2128 www-dat