[web2py] Form field defaults the second time through

2017-01-19 Thread Armando Hernandez
Assuming PostDate is a field of type datetime Try this before calling SQLFORM db.QuarterMaster.PostDate.default = request.now If PostDate is a field of type date use db.QuarterMaster.PostDate.default = request.now.date() and remove all the form.vars.PostDate assignments -- Resources: -

Re: [web2py] How to get session's Unique ID?

2017-01-19 Thread Sankhajit Das
on adding response.session_id... its displaying a flash msg "An error occured,please reload the page". Why??? And how can i fix it? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

Re: [web2py] Re: static file

2017-01-19 Thread António Ramos
if you already placed your css and js in static then in your html inside your controller folder you can do {{response.files.extend([URL('static','js/xxx.js')])}} {{response.files.append(URL('static','/js/yyy.js'))}} {{response.files.append(URL('static','/css/zzz.css'))}} {{extend 'layout.html'}}

[web2py] Re: static file

2017-01-19 Thread Dave S
On Thursday, January 19, 2017 at 12:22:06 PM UTC-8, Diego Tostes wrote: > > Hi, > > I have a html file that i i need to use with web2py, but this file access > a unique css and js file. > > > I try to add the files at the static withous success. I try to hardcoder > the script and the css at the

[web2py] static file

2017-01-19 Thread Diego Tostes
Hi, I have a html file that i i need to use with web2py, but this file access a unique css and js file. I try to add the files at the static withous success. I try to hardcoder the script and the css at the html file without success too. How can i do ? Rgds Tostes -- Resources: -

[web2py] Re: new DAL

2017-01-19 Thread Dave S
On Thursday, January 19, 2017 at 11:34:54 AM UTC-8, Andrea Fae' wrote: > > Can anyone explain exatly this? > db = DAL(myconf.get('db.uri'), > pool_size=myconf.get('db.pool_size'), > migrate_enabled=myconf.get('db.migrate'), > check_reserved=['all']) > Um,

[web2py] Re: Cannot resolve reference error if reading (select()) a table in menue.py...

2017-01-19 Thread icodk
Yes you are right. I renamed the second file so it will be pared before menu.py so now it works Thanks On Thursday, January 19, 2017 at 7:51:25 PM UTC+1, Anthony wrote: > > On Thursday, January 19, 2017 at 9:42:29 AM UTC-5, icodk wrote: >> >> Anthony >> Attached a complete welcome application

[web2py] Re: new DAL

2017-01-19 Thread Anthony
myconf is an instance of AppConfig from gluon.contrib.appconfig, which reads configuration data from a configuration file. See the highlighted areas at http://web2py.com/books/default/chapter/29/01/introduction?search=appconfig. Anthony On Thursday, January 19, 2017 at 2:34:54 PM UTC-5,

[web2py] new DAL

2017-01-19 Thread Andrea Fae'
Can anyone explain exatly this? db = DAL(myconf.get('db.uri'), pool_size=myconf.get('db.pool_size'), migrate_enabled=myconf.get('db.migrate'), check_reserved=['all']) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] Form field defaults the second time through

2017-01-19 Thread Dave S
I have a straight-forward controller function for entering the primary data: def index(): """ """ response.flash = T("Hello World") form = SQLFORM(db.QuarterMaster) form.vars.PostDate = str(request.now.year) + "-" + str(request.now.month ) + "-" + str(request.now.day) if

[web2py] Re: Cannot resolve reference error if reading (select()) a table in menue.py...

2017-01-19 Thread Anthony
On Thursday, January 19, 2017 at 9:42:29 AM UTC-5, icodk wrote: > > Anthony > Attached a complete welcome application that demonstrate the problem > Just register and you should get the error > There are two tables of interest org table in db.py and shop table in > tables.py > the org table has

Re: [web2py] table auth_user already exists

2017-01-19 Thread Dave S
On Thursday, January 19, 2017 at 6:26:44 AM UTC-8, Andrea Fae' wrote: > > morevoer I want to rename the name of auth tables files but this tables > are totally standard...I have to modify db.py? > > Il giorno giovedì 19 gennaio 2017 15:07:38 UTC+1, Andrea Fae' ha scritto: >> >> It's not working.

[web2py] Re: Web2PY MySQL DB connection and data retrieval

2017-01-19 Thread Dave S
On Wednesday, January 18, 2017 at 8:54:00 PM UTC-8, Sankhajit Das wrote: > > > > On Thursday, January 19, 2017 at 10:11:53 AM UTC+5:30, Sankhajit Das wrote: >> >> how can i store all the sqlite database in a variable? smbdy help me >> with full code pls >> > > > or how can i write all the

[web2py] Re: rename auth_* table files

2017-01-19 Thread Andrea Fae'
Maybe I resulved in this way: auth.define_tables(username=..., signature=..., migrate='',fake_migrate=True) Il giorno giovedì 19 gennaio 2017 15:52:57 UTC+1, Andrea Fae' ha scritto: > > I have this situazione. > The auth tables are named like > c8b669d15150d7109e5f7ab36744a5b7_auth_user.table

[web2py] rename auth_* table files

2017-01-19 Thread Andrea Fae'
I have this situazione. The auth tables are named like c8b669d15150d7109e5f7ab36744a5b7_auth_user.table the other tables are named like sede.table pc.table etc. I would like to rename auth talbe like "auth_user.table", "auth_permission.table", etc. How to do? Thenks -- Resources: -

Re: [web2py] table auth_user already exists

2017-01-19 Thread Andrea Fae'
morevoer I want to rename the name of auth tables files but this tables are totally standard...I have to modify db.py? Il giorno giovedì 19 gennaio 2017 15:07:38 UTC+1, Andrea Fae' ha scritto: > > It's not working. I want to rename the name of the tables but in > production I don't want this

Re: [web2py] table auth_user already exists

2017-01-19 Thread Andrea Fae'
It's not working. I want to rename the name of the tables but in production I don't want this tables. thanks Il giorno mercoledì 18 gennaio 2017 18:21:06 UTC+1, Richard ha scritto: > > databases/*files are the "memory" of web2py to know which tables have been > created in the backend and which

[web2py] Re: SQLFORM.grid, groupby and sum/count

2017-01-19 Thread Anthony
You could also do something like what is suggested here: https://github.com/web2py/web2py/issues/1553#issuecomment-270406959. Though as noted, the aggregate column will not be sortable, and you'd need to add some code to remove the link in the UI that allows it to be selected for sorting.

[web2py] Re: SQLFORM.grid, groupby and sum/count

2017-01-19 Thread Anthony
On Thursday, January 19, 2017 at 8:02:23 AM UTC-5, James Booth wrote: > > Hm, so there's no real way to do this at the minute? > > The problem is, if I do it via executesql or virtual fields, I can't > export it as CSV which is my primary goal. > You could (a) create a view in the database to

[web2py] Re: SQLFORM.grid, groupby and sum/count

2017-01-19 Thread James Booth
Hm, so there's no real way to do this at the minute? The problem is, if I do it via executesql or virtual fields, I can't export it as CSV which is my primary goal. On Monday, January 16, 2017 at 1:01:01 PM UTC, Jurgis Pralgauskis wrote: > > Hi, > > I think it echoes my isssues >

[web2py] Re: Curious about history/reasoning behind find_exposed_functions mechanism

2017-01-19 Thread Anthony
Note, if we want to support other patterns of exposing actions in controllers (besides "def some_action():"), we could simply change the pattern matcher to accommodate other possibilities. You could also simply define a function to act like more of a router and include any functionality within

Re: [web2py] Re: how to access the message parameter of a raise HTTP?

2017-01-19 Thread Carl Hunter Roach
good points! a wrapper for: request.wsgi.wsgi_environ['error_message'] = 'Explanation Text' raise HTTP(400) would keep it clean and provide a function to document the reason why this approach is implemented. You've sold me! thanks On Thu, 19 Jan 2017 at 11:39 Anthony

[web2py] Re: Curious about history/reasoning behind find_exposed_functions mechanism

2017-01-19 Thread Anthony
On Wednesday, January 18, 2017 at 9:40:35 PM UTC-5, Brendan Barnwell wrote: > > On Wednesday, January 18, 2017 at 2:12:35 PM UTC-8, Anthony wrote: >> >> A web2py controller is not like a Python module. It is meant to be >> executed in a prepared environment to generate the response to an HTTP >>

Re: [web2py] Re: how to access the message parameter of a raise HTTP?

2017-01-19 Thread Anthony
On Thursday, January 19, 2017 at 4:32:51 AM UTC-5, Carl Hunter Roach wrote: > > thanks. > > I don't like adding UI Text to URLs as it's too easy for 3rd-parties to > generate URls and have your site serve anything they like :) > Note, this is an *internal* redirect, so the end user never sees

[web2py] Re: Cannot resolve reference error if reading (select()) a table in menue.py...

2017-01-19 Thread Anthony
Please show some code and a full traceback. On Wednesday, January 18, 2017 at 11:59:20 PM UTC-5, icodk wrote: > > In general I can have a reference in table *child* to table *parent > *disregarding > the definition order. > However, If I read from table *child* (that reference table

Re: [web2py] Re: Web2py app on Android/IOS with notifications

2017-01-19 Thread Gael Princivalle
>Or better yet, configure your web server to serve those files directly, without hitting web2py at all. Yes that's the better solution, thanks. -- Gael Princivalle 2017-01-17 20:20 GMT+01:00 Anthony : > On Tuesday, January 17, 2017 at 2:01:28 PM UTC-5,

[web2py] Using Session

2017-01-19 Thread Anthony
Please show the code you have tried. -- 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

[web2py] Re: Validating field with IS_EXPR

2017-01-19 Thread Jorrit
Thanks, good to know... On Wednesday, January 18, 2017 at 11:23:20 PM UTC+1, Anthony wrote: > > If you are going to use a callable as the first argument to IS_EXPR, then > that callable should either return None (if no error) or an error message > (not sure why it was done that way -- and it's

[web2py] Using Session

2017-01-19 Thread Sankhajit Das
Can u pls tell me how to store data in session? I am unable to do 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

Re: [web2py] Re: how to access the message parameter of a raise HTTP?

2017-01-19 Thread Carl Hunter Roach
thanks. I don't like adding UI Text to URLs as it's too easy for 3rd-parties to generate URls and have your site serve anything they like :) Your suggestion of ditching the standard HTTP status codes spurs a thought: I could drop Web2py's HTTP altogether and just redirect to my own error handler