[web2py] How to ship numpy with application built with web2py

2013-06-28 Thread Aladdin Teng
I am using the web2py binary distribution on Windows as my development environment. I want to ship my application (myapp) with numpy inside so that the deployment environment does not need to have it installed. According to the discussion linked below, I should put the numpy folder inside the

[web2py] Validating document extension on upload

2013-06-28 Thread lesssugar
I need to validate extension of documents being uploaded in my app: doc, pdf, odt, ... . Image upload has its IS_IMAGE validator, which takes "extensions" argument, so list of accepted extensions can be provided. The only validator I see for non-image uploads is IS_UPLOAD_FILENAME, which takes

[web2py] Re: Stop menu from collapsing

2013-06-28 Thread Paolo Caruccio
This should work: replace navbar section in layout.html with {{=response.flash or ''}} {{is_mobile=request.user_agent().is_mobile}} {{=response.logo or ''}} {{='auth' in globals() and auth.na

[web2py] Re: Smartgrid link more than one tables Possible?

2013-06-28 Thread Jim S
That's pretty much what it does. -Jim On Friday, June 28, 2013 2:19:35 PM UTC-5, greenpoise wrote: > > Can more than one table be linked? sort of in like a stairs/hierarchy. > > Parent > -->child > -->childofchild > > > > -- --- You received this message because you are subs

[web2py] Smartgrid link more than one tables Possible?

2013-06-28 Thread greenpoise
Can more than one table be linked? sort of in like a stairs/hierarchy. Parent -->child -->childofchild -- --- 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, s

[web2py] Re: SQLFORM.grid ondelete

2013-06-28 Thread Niphlod
sure. first of all, all callbacks accepts some parameters. the ondelete takes the table and the id of the deleted row. If you instead want to play with request.args and vars, a delete request looks like /app/controller/function/delete/table_name/id so the id of the deleted record is the last arg

[web2py] curious how you all handle database engine migrations

2013-06-28 Thread Michael Herman
http://www.realpython.com/blog/python/web2py-migrating-from-sqlite-to-mysql/ -- --- 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...@googlegroup

[web2py] SQLFORM.grid ondelete

2013-06-28 Thread Kyle Flanagan
I have an SQLFORM.grid w/ an ondelete calling a function customer_delete(). However, the the function is not being called and the records are not actually being deleted from the DB. If I remove the "ondelete=customer_delete" in my grid args, the records are being deleted. The way I understand i

[web2py] Re: sqlform.factory widget in field problem

2013-06-28 Thread António Ramos
Once again, thank you No dia Sexta-feira, 28 de Junho de 2013, Tom Russelltom@caregointl.comescreveu: > Actually probably just comment out the line: > > fs3=form[0][-1] # submit row (last) > > and that I think will put the submit outside the fieldset. > > > On Fri, Jun 28, 2013 at 2:50 AM, An

[web2py] Re: updating multiple tables - how to have all updates in the same transaction?

2013-06-28 Thread Cliff Kachinske
Anthony, Thanks. On Friday, June 28, 2013 1:49:12 PM UTC-4, Anthony wrote: > > I suppose use either an onaccept callback with the SQLFORM, or set up > _after_insert and _after_update callbacks on the db.item_batch table (those > will run any time db.item_batch is changed, even if not via a form

[web2py] Re: updating multiple tables - how to have all updates in the same transaction?

2013-06-28 Thread Anthony
I suppose use either an onaccept callback with the SQLFORM, or set up _after_insert and _after_update callbacks on the db.item_batch table (those will run any time db.item_batch is changed, even if not via a form). Anthony On Friday, June 28, 2013 1:41:05 PM UTC-4, Cliff Kachinske wrote: > > I

[web2py] Re: Passing an arg

2013-06-28 Thread Anthony
> > record = db.patient(request.args(0)) db.appointment.patient.default = record > Above "record" is a row object, but db.appointment.patient is a reference field, which simply stores the integer ID of the record it references. So, that second line should just be: db.appointment.p

Re: [web2py] updating multiple tables - how to have all updates in the same transaction?

2013-06-28 Thread Tom Russell
I could be wrong and am still new here but maybe SQLFORM.Factory? Thats what I use on a form that has 2 tables. On Fri, Jun 28, 2013 at 1:41 PM, Cliff Kachinske wrote: > I have two tables something like this: > > db.define_table('item', > Field('name'), > Field('on_hand', integer), > ) > >

[web2py] updating multiple tables - how to have all updates in the same transaction?

2013-06-28 Thread Cliff Kachinske
I have two tables something like this: db.define_table('item', Field('name'), Field('on_hand', integer), ) db.define_table('item_batch', Field('item', 'reference db.item' ...), Field('batch_yield', integer), ) Every time I insert a item_batch record, I increment the on_hand field of the

Re: [web2py] Re: confused about db.py settings

2013-06-28 Thread Tom Russell
Nice, I will check that out. On Fri, Jun 28, 2013 at 1:37 PM, Anthony wrote: > Yea thanks I tried that as well with no luck. > > > Then you're doing something else wrong. It might help if you show all of > the code. If you have a model file that does: > > db = DAL(...) > ... > auth = Auth(db) >

Re: [web2py] Re: confused about db.py settings

2013-06-28 Thread Tom Russell
Well whatever the case was it did give me some errors, cant remember which now but I tried a few things to no avail. I know its always this way starting out, been around the block a few times already :) On Fri, Jun 28, 2013 at 1:34 PM, LightDot wrote: > On Friday, June 28, 2013 6:59:19 PM UTC+

[web2py] Passing an arg

2013-06-28 Thread Tom Russell
I have a smartgrid with a link in it like this: links = [lambda row: A(T('Create Appointment'),_href=URL("default", "appointment_create",args=[row.id]))] And I pass that to this function: @auth.requires_login() def appointment_create(): record = db.patient(request.args(0)) db.appointment

Re: [web2py] Re: confused about db.py settings

2013-06-28 Thread Anthony
> > Yea thanks I tried that as well with no luck. Then you're doing something else wrong. It might help if you show all of the code. If you have a model file that does: db = DAL(...) ... auth = Auth(db) auth.define_tables() The db.auth_user will be available in any subsequent model as well as

Re: [web2py] Re: confused about db.py settings

2013-06-28 Thread LightDot
On Friday, June 28, 2013 6:59:19 PM UTC+2, Tom Russell wrote: > > Yea thanks I tried that as well with no luck. > That's impossible. But never mind, hang in there, after you finish your first project, you'll be remembering this beginnings with a smile. > I ended up just creating a new db_wizar

Re: [web2py] Re: confused about db.py settings

2013-06-28 Thread Tom Russell
Yea thanks I tried that as well with no luck. I ended up just creating a new db_wizard.py in my model and this set up works great now. Its mentioned in the book but thats it, just mentioned. For new users there should be a guide to setting all of this up correctly. Maybe there is? I could write som

[web2py] Re: confused about db.py settings

2013-06-28 Thread LightDot
Well, you have: db = DAL('sqlite://storage.sqlite',pool_size=1,check_reserved=['all']) defined, then you initiate auth with: auth.define_tables(username=True, signature=True) which sets up auth tables etc. in the above database. But then you override the previously set db with: db = DAL('sqli

[web2py] confused about db.py settings

2013-06-28 Thread Tom Russell
I am confused about how I have my db.py set up for tables etc. At the top I have what is generated for me: if not request.env.web2py_runtime_gae: ## if NOT running on Google App Engine use SQLite or other DB db = DAL('sqlite://storage.sqlite',pool_size=1,check_reserved=['all']) else:

Re: [web2py] sqlform.factory widget in field problem

2013-06-28 Thread Tom Russell
Actually probably just comment out the line: fs3=form[0][-1] # submit row (last) and that I think will put the submit outside the fieldset. On Fri, Jun 28, 2013 at 2:50 AM, António Ramos wrote: > I dont understand how that gets the submit button out of the last fieldset > > > 2013/6/28 T

[web2py] Re: Builtwith.com now recognizes web2py as a framework.

2013-06-28 Thread pythONtherocks
Massimo, >From here on, when someone looks to see what technologies are behind any given project, it will identify web2py as a framework and reports it in use. (it is on demand) The exact markers they use to identify web2py was not disclosed but I will shot Gary an email if that is of importanc

[web2py] Export file without id of related table

2013-06-28 Thread Rohitraj Sharma
Export file from the two linked tables Here is the example of DB Schema def get_name(c): row = db(db.child.id == c).select(db.child.name).first() return row.name *Child Table* * * db.define_table('child', Field('name') ) *P

[web2py] Re: test_has_right_title does not pass in the exercise given in :"http://killer-web-development.com/"

2013-06-28 Thread shailaja
I tried what you suggested, but it gave the same error. :( On Tuesday, June 25, 2013 8:24:48 PM UTC+5:30, dhmorgan wrote: > > you're welcome; I'd been wanting to run through the tutorial, > > yes,within test_static_pages.py (though I guess you've probably tried it > by now) it will work that wa

[web2py] Re: Why is compiled application slower than the one without compilation?

2013-06-28 Thread Massimo Di Pierro
Vey interesting. I have no explanation the compilation is just caching pyc files. On Friday, 28 June 2013 07:49:47 UTC-5, David Marko wrote: > > I just tested my web2py installation using Apache Benchmark and found > strange thing. When I benchmarked common examples app, that is available in >

[web2py] Why is compiled application slower than the one without compilation?

2013-06-28 Thread David Marko
I just tested my web2py installation using Apache Benchmark and found strange thing. When I benchmarked common examples app, that is available in web2py core (this url: /examples/simple_examples/hello5 ) I found that compiled app gives me around 100 req/sec but uncompiled 155 req/sec which is

[web2py] Re: datetime operation with dal (postgres)

2013-06-28 Thread Niphlod
@paolo: You can't mix & match python with SQL and expect consistent results. @massimo: there's a problem: they'll never be consistent among databases. Some db return timerange, some number of days, some number of seconds, when you subtract two dates without involving functions. that's one of the

[web2py] Re: datetime operation with dal (postgres)

2013-06-28 Thread Paolo valleri
Hi Massimo, can you point out how to write query with date diff? I tried this: db(diff_date > timedelta(days=4)).select() and I got the same ticket, I don't know if this is there right way for expressing query with date_diff. Paolo On Friday, June 28, 2013 12:41:13 PM UTC+2, Massimo Di Pierro w

[web2py] Re: upgrading eCardsOnMap to API V3

2013-06-28 Thread webpypy
As far as i remember, it worked fine. That was one year ago. > >> >> Ashraf >> > -- --- 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

[web2py] Re: How to get a list of all fields in a table?

2013-06-28 Thread Woody
Perfect! Thanks. On Thursday, June 27, 2013 4:43:07 PM UTC-4, Niphlod wrote: > > tables list = db.tables > field list for table 'a_table' = db.a_table.fields > > > > On Thursday, June 27, 2013 10:30:24 PM UTC+2, Woody wrote: >> >> I hope the answer to this is something that's not too obvious, but

[web2py] Re: datetime operation with dal (postgres)

2013-06-28 Thread Massimo Di Pierro
Please open a ticket about this. Expressions like date_diff were designed to be in the query, not in the list of selected columns. I think this can be done but need to check what breaks. On Friday, 28 June 2013 03:02:06 UTC-5, Paolo valleri wrote: > > Dear all, > I am trying to run simple mathe

[web2py] Re: Pls, upgrade eCardsonMap to V3

2013-06-28 Thread Massimo Di Pierro
I do not understand this. On Monday, 19 March 2012 16:11:33 UTC-5, webpypy wrote: > > Hi, > > Pls, upgrade eCardsonMap to V3 > > Regards, > > Ashraf -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and sto

Re: [web2py] IMPORTANT: web2py 2.6.0-development

2013-06-28 Thread Niphlod
@testers, please upgrade to trunk. A few changes went in that needs to be tested as well. -- --- 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.

[web2py] Re: Using convert_tz with DAL

2013-06-28 Thread Niphlod
are you aware that web2py handles timezones automatically if set to do so ? If you want to leverage mysql own function, you have to write raw queries for that. On Friday, June 28, 2013 11:35:03 AM UTC+2, Stelios Koroneos wrote: > > Greetings. > > I am saving all time related references in UTC ti

[web2py] Using convert_tz with DAL

2013-06-28 Thread Stelios Koroneos
Greetings. I am saving all time related references in UTC timezone and want to convert them to the user's timezone when the request to display them comes. Mysql offers the convert_tz which can handle this pretty much 'automagically' during the query. Is there a way to use convert_tz from a 'stan

Re: [web2py] Re: DAL and schema

2013-06-28 Thread mcamel
Yes, the word ACROSS clarifies it. Besides, i've got another problem escaping SQL. I want to add this to the SQL sentence: WHERE b.type LIKE 'L''%' E.g. all types beggining with an L and following with an apostrophe. I've escaped the apostrophe writing it twice, but if filter is user input i

[web2py] datetime operation with dal (postgres)

2013-06-28 Thread Paolo valleri
Dear all, I am trying to run simple mathematical operations with datetime and postgres as backend (http://www.postgresql.org/docs/9.0/static/functions-datetime.html) I've prepared this simple example code: from datetime import timedelta db.define_table('test_sum', Field('first_int', 'integer'),