[web2py] Re: Web2py: Using images in HTML data

2015-04-17 Thread Annet
Hi Joe,

In the book is an example of how to embed an image using helpers:


A(IMG(_src=URL('static','logo.png'), _alt=My Logo), 
_href=URL('default','index'))


In one of my apps I upload images to a separate app and within that app to 
separate folders, to 
embed these images I use:

img src={{=UPLOADSDOMAIN}}/nodeID{{='%s' 
%str(request.args(0))}}/{{=row.image}} class=img-responsive /

where UPLOADSDOMAIN is defined as a constant in a module and references:

'/dbmodel/static/uploads'

and nodeID{{='%s' %str(request.args(0))}} references the separate folder and
row.image contains image_name.png


Kind regards,

Annet

-- 
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 Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] validate hidden field

2015-04-17 Thread Annet
I have the following table and validator definitions:

db.define_table('cal_opening_hours',
Field('nodeID', 'reference nd_node', **isnode),

migrate = False)


isnode = dict(default='', requires=[IS_IN_DB(db, 'nd_node.id', '%(id)s', 
zero='Selecteer een node',
 error_message='Node niet in 
database')], ondelete='CASCADE',
  notnull=True, writable=False, readable=False)


In the insert function I have the following code:

db[table].nodeID.default = nodeID
form = SQLFORM(table, showid=False, hidden=dict(nodeID=nodeID))

I thought this would validate the nodeID, however, when I comment out the 
line
db[table].nodeID.default = nodeID the openinghour is inserted without 
nodeID.

Why isn't the hidden field being validated?


Kind regards,

Annet

-- 
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 Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Need help with web2pyslices plugin administration

2015-04-17 Thread Mirek Zvolský
Thank you in advance.
I think we need good central place for plugins and this one is already 
integrated with admin app. But it must work a little..

My entries from yesterday have subject: Testing
In admin, install plugins, is still visible just the upload from previous 
month, the two uploads from yesterday aren't visible.

-- 
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 Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] validate hidden field

2015-04-17 Thread Anthony
As mentioned in the book, hidden fields are just meant to be submitted with the 
form - the are not moved into form.vars nor validated. You can access them via 
request.cars.

Anthony

-- 
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 Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: validate hidden field

2015-04-17 Thread Leonel Câmara
Along with Anthony's answer.  
  
Your code seems seriously WTF, why do you have a default='' for a 
notnul=True field?
Why do you want to validate a field that is not writable?

Anyway you can use onvalidation to do your custom checks if you really want 
to validate 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 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 more options, visit https://groups.google.com/d/optout.


Re: [web2py] type 'exceptions.AttributeError' 'module' object has no attribute 'items'

2015-04-17 Thread Dimid Duchovny
This error doesn't occur when downloading the stable source from
http://www.web2py.com/examples/static/web2py_src.zip

2015-04-17 17:32 GMT+03:00 Dimid Duchovny dim...@gmail.com:

 Hello,

 I get this error right after cloning:

 git clone --recursive https://github.com/web2py/web2py.git
 [snip]
 cd web2py/
 python web2py.py
 ERROR:root:New installation error: unable to create welcome.w2p file
 web2py Web Framework
 Created by Massimo Di Pierro, Copyright 2007-2015
 Version 2.10.3-stable+timestamp.2015.04.02.16.28.49
 Database drivers available: pymysql, imaplib, pg8000, sqlite3, sqlite2,
 pyodbc, mysqlconnector
 please visit:
 http://127.0.0.1:8000/
 starting browser...
 unnamed app(3684) ClientApp::doIt: Creating ClientApp
 kioclient(3684) ClientApp::kde_open: KUrl(http://127.0.0.1:8000/;)
 kioclient(3684) KSharedUiServerProxy::KSharedUiServerProxy: kuiserver
 registered


 commit f33ccf3366bc19c8

 In the browser, visiting http://127.0.0.1:8000 and opening the ticket:
 Error ticket for welcomeTicket ID

 127.0.0.1.2015-04-17.15-40-48.2e727d5f-799a-4402-bc0e-0ced3b8f013b
 type 'exceptions.AttributeError' 'module' object has no attribute
 'items'
 Versión
 web2py™Version 2.10.3-stable+timestamp.2015.04.02.16.28.49PythonPython 2.7
 .6: /usr/bin/python (prefix: /usr)

 Rastreo

 1.
 2.
 3.
 4.
 5.
 6.
 7.
 8.
 9.
 10.
 11.

 Traceback (most recent call last):
   File /home/dimid/web2py/gluon/restricted.py, line 227, in restricted
 exec ccode in environment
   File /home/dimid/web2py/applications/welcome/models/db.py 
 http://127.0.0.1:8000/admin/default/edit/welcome/models/db.py, line 20, in 
 module
 db = DAL(myconf.take('db.uri'), pool_size=myconf.take('db.pool_size', 
 cast=int), check_reserved=['all'])
   File /home/dimid/web2py/gluon/packages/dal/pydal/base.py, line 171, in 
 __call__
 obj = super(MetaDAL, cls).__call__(*args, **kwargs)
   File /home/dimid/web2py/gluon/packages/dal/pydal/base.py, line 475, in 
 __init__
 for k, v in self.serializers.items():
 AttributeError: 'module' object has no attribute 'items'



  --
 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 a topic in the
 Google Groups web2py-users group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/web2py/y-2eBof7Ips/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 web2py+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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 Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] list:boolean

2015-04-17 Thread 黄祥
hi, 

i've seen in opencart that they have some sort of imho looks like 
list:boolean in web2py (yet it's not exist, checked on book), so my 
question is it possible to have some kind of it using web2py? 
please see attached file that taken from opencart

thanks and best regards,
stifan

-- 
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 Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Web2py: Using images in HTML data

2015-04-17 Thread Joe Magaro
Thanks Annet: I am aware of web2py URL helpers. I use them inside of my 
views.

However in this case, they wont work for me as the data is stored in a 
table and output to a web page, I require another method.

On Friday, April 17, 2015 at 3:01:17 AM UTC-4, Annet wrote:

 Hi Joe,

 In the book is an example of how to embed an image using helpers:


 A(IMG(_src=URL('static','logo.png'), _alt=My Logo), 
 _href=URL('default','index'))


 In one of my apps I upload images to a separate app and within that app to 
 separate folders, to 
 embed these images I use:

 img src={{=UPLOADSDOMAIN}}/nodeID{{='%s' 
 %str(request.args(0))}}/{{=row.image}} class=img-responsive /

 where UPLOADSDOMAIN is defined as a constant in a module and references:

 '/dbmodel/static/uploads'

 and nodeID{{='%s' %str(request.args(0))}} references the separate folder 
 and
 row.image contains image_name.png


 Kind regards,

 Annet


-- 
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 Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: A bug in _after_insert callback's document (book)? And more.

2015-04-17 Thread Anthony


 2. Even without above snippet, in our context I would say a rare 
 500-response-but-it-would-be-gone-if-you-simply-retry is (arguably?) still 
 better than, silently creating duplicated user accounts which clearly 
 violates the universal expectation of such a fundamental db scheme 
 assumption.


 This doesn't seem to be a likely problem -- two different users would 
 have to be trying to register with the same username/email within 
 milliseconds of each other. On the other hand, I suppose this would make 
 the 500 response in such a case equally rare (assuming we set unique=True 
 in the table definition).

 Well, in my case, the delay was caused by sending email, so it is 
 definitely not milliseconds of each other. It takes some 2 or 3 seconds, 
 maybe even longer. And during this period, it is not that another user 
 would try to register with same username/email, it is somehow the same user 
 request would (seemingly?) be resent (by the user's app or by my reverse 
 proxy apache or by a wsgi middleware or whatever, which I don't know yet).


Got it, but that sounds like a bug to be fixed. It shouldn't be possible to 
re-submit the standard registration form twice because the _formkey token 
prevents duplicate submissions. Are you using a different method for 
submitting registration data?
 

 Although I agree with your earlier suggestion to re-engineer the email 
 sending part to a separated queue, which is a good idea indeed, but as a 
 more general topic, I still think it would be good to have web2py to define 
 unique=True for username and/or email in auth_user table by default. 
 Personally I am willing to trade a rare (0.01%?) chance of a user-scary 500 
 error ticket for the 100% guarantee of no duplication in auth_user table. 
 Don't you think so?


Sounds reasonable. Maybe submit an issue and/or bring it up on the 
developers list.

Anthony

-- 
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 Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: A bug in _after_insert callback's document (book)? And more.

2015-04-17 Thread Anthony


 Thanks for your hint, Anthony. I did not realize that I can set that 
 unique attribute after db.define_tables(). Will definitely try to do that 
 in my projects.


On second thought, I don't think that will trigger a migration in the 
database, so you will probably have to do that manually (but it only needs 
to happen once).

Anthony 

-- 
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 Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Two SQLFORMs side by side?

2015-04-17 Thread Richard Vézina
'reference tablename' = 1 to many
'list:reference tablename' = many to many it denormalised that why I put
it between double quotes

Richard

On Thu, Apr 16, 2015 at 5:13 PM, LoveWeb2py atayloru...@gmail.com wrote:

 Richard,

 I did want to have a foreign key for info_about_field1. I guess I could do
 a reference field1 ?



 On Thursday, April 16, 2015 at 3:02:51 PM UTC-4, Richard wrote:

 There is no relation between both tables... You can embed 2 forms as
 component (LOAD())

 if you were having list:reference type field it is differents and you
 have to question yourself if you are not better to have something like
 SELECT_OR_ADD_OPTION() or even better AutocompleteSelectOrAddOption()
 widget... I recently update my old AutocompleteSelectOrAddOption()
 widget (not finish yet) in order to move from jquery ui dialog to bootstrap
 modal... I will publish a web2py slice when done.

 Just ask if it interest you I can publish preview here...

 Richard

 On Thu, Apr 16, 2015 at 2:08 PM, LoveWeb2py atayl...@gmail.com wrote:

 Hello,

 I'd like to have two SQLFORMs right next to each other.

 The second SQLFORM is just going to be linked to the field in table 1,
 but will be used so the student can make additional comments about a field.
 Model will look like this:

 db.define_table('main_table',
 Field('field1','string'),
 Field('field2','string'),
 migrate=False)

 db.define_table('second_table',
 Field('info_about_field1','list:string'),
 Field('info_about_field2','list:string')
 migrate=False)

 My question is... is it possible to have the second_table as a link
 underneath the main_table field. I want to have a modal pop up so they can
 enter additional information about the field


  --
 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
 Groups web2py-users group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to web2py+un...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


  --
 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 Groups
 web2py-users group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to web2py+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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 Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Cant install via git repo

2015-04-17 Thread Richard Vézina
Hard to say without knowing which git repo you clone and how do you clone
it...

Richard

On Thu, Apr 16, 2015 at 8:34 PM, Joe Magaro joe.maga...@gmail.com wrote:

 Hi, on my web2py install I tried to install some applications via a git
 repo. I have tried several but keep receiving the error below.

 Any idea what is causing this?


 Traceback (most recent call last):
   File /home/www-data/web2py/gluon/restricted.py, line 227, in restricted
 exec ccode in environment
   File /home/www-data/web2py/applications/admin/controllers/default.py 
 https://www.speckledcartel.com/admin/default/edit/admin/controllers/default.py,
  line 1944, in module
   File /home/www-data/web2py/gluon/globals.py, line 393, in lambda
 self._caller = lambda f: f()
   File /home/www-data/web2py/applications/admin/controllers/default.py 
 https://www.speckledcartel.com/admin/default/edit/admin/controllers/default.py,
  line 256, in site
 new_repo = git.Repo.clone_from(form_update.vars.url, target)
   File /usr/local/lib/python2.7/dist-packages/git/repo/base.py, line 844, 
 in clone_from
 return cls._clone(Git(os.getcwd()), url, to_path, GitCmdObjectDB, 
 progress, **kwargs)
   File /usr/local/lib/python2.7/dist-packages/git/repo/base.py, line 791, 
 in _clone
 v=True, **add_progress(kwargs, git, progress))
   File /usr/local/lib/python2.7/dist-packages/git/cmd.py, line 431, in 
 lambda
 return lambda *args, **kwargs: self._call_process(name, *args, **kwargs)
   File /usr/local/lib/python2.7/dist-packages/git/cmd.py, line 802, in 
 _call_process
 return self.execute(make_call(), **_kwargs)
   File /usr/local/lib/python2.7/dist-packages/git/cmd.py, line 556, in 
 execute
 **subprocess_kwargs
   File /usr/lib/python2.7/subprocess.py, line 710, in __init__
 errread, errwrite)
   File /usr/lib/python2.7/subprocess.py, line 1327, in _execute_child
 raise child_exception
 OSError: [Errno 2] No such file or directory

  --
 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 Groups
 web2py-users group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to web2py+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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 Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: validate hidden field

2015-04-17 Thread Annet
Hi,

Thank you both for your reply.

@Anthony

In 2012 I had an issue related to validation, the following solution was 
given:

including nodeID as a hidden field (if you're willing to have nodeID 
published on the source page, the normal user wouldn't see this) form = 
SQLFORM(db.tie, hidden=dict(nodeID=6)) sends a hidden field nodeID with 6 
as value -- it's in request.vars -- the validator fires

From your answer I learn that I either did not understand the 2012 solution 
or now web2py handels
hidden fields differently.  


@Leonel

Your code seems seriously WTF, why do you have a default='' for a 
 notnul=True field?


Because of Massimo's reply to this question:

https://groups.google.com/forum/#!topic/web2py/kwQBxeKy0ug

 

 Why do you want to validate a field that is not writable?


 It's a foreign key which most of the time (not always) gets its value in a 
function:

nodeID = auth.user.nodeID
 # other code
db[table].nodeID.default = nodeID

appadmin ignores writable and readable and checks if the node is in de 
database.


Kind regards,

Annet

-- 
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 Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: validate hidden field

2015-04-17 Thread Anthony


 In 2012 I had an issue related to validation, the following solution was 
 given:

 including nodeID as a hidden field (if you're willing to have nodeID 
 published on the source page, the normal user wouldn't see this) form = 
 SQLFORM(db.tie, hidden=dict(nodeID=6)) sends a hidden field nodeID with 6 
 as value -- it's in request.vars -- the validator fires

 From your answer I learn that I either did not understand the 2012 
 solution or now web2py handels
 hidden fields differently.  


I think that solution was simply mistaken -- you get the hidden field in 
request.vars, but it doesn't trigger a validation. As an alternative, you 
could include the nodeID in the form as a regular field (i.e., set it to 
writable), but then use CSS to hide the input element. Or just do custom 
validation.

Anthony

-- 
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 Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] type 'exceptions.AttributeError' 'module' object has no attribute 'items'

2015-04-17 Thread Dimid Duchovny
Hello,

I get this error right after cloning:

git clone --recursive https://github.com/web2py/web2py.git
[snip]
cd web2py/
python web2py.py
ERROR:root:New installation error: unable to create welcome.w2p file
web2py Web Framework
Created by Massimo Di Pierro, Copyright 2007-2015
Version 2.10.3-stable+timestamp.2015.04.02.16.28.49
Database drivers available: pymysql, imaplib, pg8000, sqlite3, sqlite2, 
pyodbc, mysqlconnector
please visit:
http://127.0.0.1:8000/
starting browser...
unnamed app(3684) ClientApp::doIt: Creating ClientApp
kioclient(3684) ClientApp::kde_open: KUrl(http://127.0.0.1:8000/;)
kioclient(3684) KSharedUiServerProxy::KSharedUiServerProxy: kuiserver 
registered


commit f33ccf3366bc19c8

In the browser, visiting http://127.0.0.1:8000 and opening the ticket:
Error ticket for welcomeTicket ID

127.0.0.1.2015-04-17.15-40-48.2e727d5f-799a-4402-bc0e-0ced3b8f013b
type 'exceptions.AttributeError' 'module' object has no attribute 'items'
Versión  
web2py™Version 2.10.3-stable+timestamp.2015.04.02.16.28.49PythonPython 2.7.6
: /usr/bin/python (prefix: /usr)

Rastreo

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.

Traceback (most recent call last):
  File /home/dimid/web2py/gluon/restricted.py, line 227, in restricted
exec ccode in environment
  File /home/dimid/web2py/applications/welcome/models/db.py 
http://127.0.0.1:8000/admin/default/edit/welcome/models/db.py, line 20, in 
module
db = DAL(myconf.take('db.uri'), pool_size=myconf.take('db.pool_size', 
cast=int), check_reserved=['all'])
  File /home/dimid/web2py/gluon/packages/dal/pydal/base.py, line 171, in 
__call__
obj = super(MetaDAL, cls).__call__(*args, **kwargs)
  File /home/dimid/web2py/gluon/packages/dal/pydal/base.py, line 475, in 
__init__
for k, v in self.serializers.items():
AttributeError: 'module' object has no attribute 'items'



-- 
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 Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: list:boolean

2015-04-17 Thread Anthony
In terms of the data model, that could be handled with a list:string or 
list:reference field. Then you just need a custom widget to present that as 
a set of checkboxes on the page. Actually, web2py includes a basic 
checkboxes widget, though it doesn't look like the screenshot you have 
shown.

Anthony

On Friday, April 17, 2015 at 10:51:39 AM UTC-4, 黄祥 wrote:

 hi, 

 i've seen in opencart that they have some sort of imho looks like 
 list:boolean in web2py (yet it's not exist, checked on book), so my 
 question is it possible to have some kind of it using web2py? 
 please see attached file that taken from opencart

 thanks and best regards,
 stifan


-- 
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 Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: A bug in _after_insert callback's document (book)? And more.

2015-04-17 Thread Ray (a.k.a. Iceberg)


On Friday, April 17, 2015 at 6:35:09 AM UTC-7, Anthony wrote:

 2. Even without above snippet, in our context I would say a rare 
 500-response-but-it-would-be-gone-if-you-simply-retry is (arguably?) still 
 better than, silently creating duplicated user accounts which clearly 
 violates the universal expectation of such a fundamental db scheme 
 assumption.


 This doesn't seem to be a likely problem -- two different users would 
 have to be trying to register with the same username/email within 
 milliseconds of each other. On the other hand, I suppose this would make 
 the 500 response in such a case equally rare (assuming we set unique=True 
 in the table definition).

 Well, in my case, the delay was caused by sending email, so it is 
 definitely not milliseconds of each other. It takes some 2 or 3 seconds, 
 maybe even longer. And during this period, it is not that another user 
 would try to register with same username/email, it is somehow the same user 
 request would (seemingly?) be resent (by the user's app or by my reverse 
 proxy apache or by a wsgi middleware or whatever, which I don't know yet).


 Got it, but that sounds like a bug to be fixed. It shouldn't be possible 
 to re-submit the standard registration form twice because the _formkey 
 token prevents duplicate submissions. Are you using a different method for 
 submitting registration data?


It is because I am providing a RESTFUL api for the app to call. That is why 
I (have to?) bypass all the good things in the default form-based 
infrastructure such as double submit prevention. Sad but true.
 

  

 Although I agree with your earlier suggestion to re-engineer the email 
 sending part to a separated queue, which is a good idea indeed, but as a 
 more general topic, I still think it would be good to have web2py to define 
 unique=True for username and/or email in auth_user table by default. 
 Personally I am willing to trade a rare (0.01%?) chance of a user-scary 500 
 error ticket for the 100% guarantee of no duplication in auth_user table. 
 Don't you think so?


 Sounds reasonable. Maybe submit an issue and/or bring it up on the 
 developers list.


OK. See https://github.com/web2py/web2py/issues/921

By the way, thank you Anthony for your follow-up info in another post about 
the manually setup unique=True workaround.

-- 
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 Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Does Lazy Tables setting only have relevance if migration = True?

2015-04-17 Thread Alex Glaros
sorry, didn't see your question above.  

can you please describe details of how to make the change?

-- 
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 Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Setup.py

2015-04-17 Thread Angelo Compagnucci
Hello List,

I'm trying to understand how setup.py works. It seems to me that it
doesn't work.

There is no web2py binary in system path or somewhere else.

It's a bug or feature?

Thank you!

Sincerely, Angelo

-- 
Profile: http://it.linkedin.com/in/compagnucciangelo

-- 
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 Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Does Lazy Tables setting only have relevance if migration = True?

2015-04-17 Thread Anthony
On Friday, April 17, 2015 at 3:26:12 PM UTC-4, Alex Glaros wrote:

 if plugin code is not compatible with lazy tables, should should someone 
 report a bug or make fix request?


I don't know if the plugin is being maintained (it is not part of web2py). 
If not, you can simply make the change yourself.

Anthony

-- 
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 Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Does Lazy Tables setting only have relevance if migration = True?

2015-04-17 Thread Anthony


On Thursday, April 16, 2015 at 5:30:35 PM UTC-4, Alex Glaros wrote:

 Anthony,

 editor already only defined in field, but error persists.


The error results from the plugin code -- have you fixed that?

Anthony

-- 
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 Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Does Lazy Tables setting only have relevance if migration = True?

2015-04-17 Thread Alex Glaros
if plugin code is not compatible with lazy tables, should should someone 
report a bug or make fix request?

Alex

-- 
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 Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: A bug in _after_insert callback's document (book)? And more.

2015-04-17 Thread Anthony


 Well, in my case, the delay was caused by sending email, so it is 
 definitely not milliseconds of each other. It takes some 2 or 3 seconds, 
 maybe even longer. And during this period, it is not that another user 
 would try to register with same username/email, it is somehow the same user 
 request would (seemingly?) be resent (by the user's app or by my reverse 
 proxy apache or by a wsgi middleware or whatever, which I don't know yet).


 Got it, but that sounds like a bug to be fixed. It shouldn't be possible 
 to re-submit the standard registration form twice because the _formkey 
 token prevents duplicate submissions. Are you using a different method for 
 submitting registration data?


 It is because I am providing a RESTFUL api for the app to call. That is 
 why I (have to?) bypass all the good things in the default form-based 
 infrastructure such as double submit prevention. Sad but true.


You could still implement your own functionality to prevent double 
submission, such as issuing a one-time use token that gets submitted with 
the registration.

Anthony

-- 
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 Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Creating a webhook handler for IFTTT and using routes in the hack.

2015-04-17 Thread Jason (spot) Brower
I found this...
https://github.com/captn3m0/ifttt-webhook
Which is a work around to connect ifttt as a webhook to your webserver.
However, I need to route for servername.com/xmlrpc.php to handle the
authentication for the server and make the connection work.
Then I can start throwing data at the server and it will, hopefully,
provide me with some webhooks, to play with for my ifttt stuff.
Any help on getting the routes to handle the situation like in the github
instructions?
BR,
Jason

-- 
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 Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] using pydal to connect to app in standalone mode

2015-04-17 Thread Ron Chatterjee

from pydal import DAL, Field


db = 
DAL('sqlite://storage.sqlite',folder='C:\web2py\applications\my_app_name\databases',auto_import=True);

in my application models/db.py I have my database definition.

I can't connect through pydal. I get an error:

  return self.driver.Connection(dbpath, **driver_args)
OperationalError: unable to open database file


Am I missing something? Basically trying to use pydal as a standalone to 
load existing database. If it is even possible.  

-- 
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 Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: list:boolean

2015-04-17 Thread Richard Vézina
It mays also be possible that this display is only obtain with JS plugin
apply on select multiple html node.

Richard

On Fri, Apr 17, 2015 at 11:08 AM, Anthony abasta...@gmail.com wrote:

 In terms of the data model, that could be handled with a list:string or
 list:reference field. Then you just need a custom widget to present that as
 a set of checkboxes on the page. Actually, web2py includes a basic
 checkboxes widget, though it doesn't look like the screenshot you have
 shown.

 Anthony


 On Friday, April 17, 2015 at 10:51:39 AM UTC-4, 黄祥 wrote:

 hi,

 i've seen in opencart that they have some sort of imho looks like
 list:boolean in web2py (yet it's not exist, checked on book), so my
 question is it possible to have some kind of it using web2py?
 please see attached file that taken from opencart

 thanks and best regards,
 stifan

  --
 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 Groups
 web2py-users group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to web2py+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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 Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: upload e CASCADE delete

2015-04-17 Thread pang


El miércoles, 15 de enero de 2014, 15:39:07 (UTC+1), Anthony escribió:

 The cascading delete is handled by the database, so the web2py DAL is not 
 executing the delete from the db.allegato table and therefore doesn't have 
 the opportunity to run the _before_delete and _after_delete callbacks (the 
 former is used to autodelete uploaded files).


I just run into this issue, I was wondering if it is advisible to perform 
the CASCADE on web2py, something like:

def cascader(t1,t2,f):
def func(s):
for r in s.select(t1.id):
s = db(f==r.id)
for func2 in t2._before_delete:
func2(s)
return func

for t in db:
for f in t:
if f.type.startswith('reference'):
ref_table = db[f.type[10:]]
ref_table._before_delete.append(cascader(ref_table,t,f))


this would bring problems for circular references, does not include lists, 
etc, but is it a reasonable idea?

-- 
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 Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: using pydal to connect to app in standalone mode

2015-04-17 Thread Massimo Di Pierro
This should be possible. This is the purpose of pydal. Perhaps the file 
truly corrupted or the folder is missing/incorrect?

On Friday, 17 April 2015 17:47:42 UTC-5, Ron Chatterjee wrote:


 from pydal import DAL, Field


 db = 
 DAL('sqlite://storage.sqlite',folder='C:\web2py\applications\my_app_name\databases',auto_import=True);

 in my application models/db.py I have my database definition.

 I can't connect through pydal. I get an error:

   return self.driver.Connection(dbpath, **driver_args)
 OperationalError: unable to open database file


 Am I missing something? Basically trying to use pydal as a standalone to 
 load existing database. If it is even possible.  


-- 
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 Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Application Arquitecture advices

2015-04-17 Thread Sébastien Loix
I am mixing both client and server side code according to my need.

All the json data loaded into angular is made through *Restangular *calls 
to a controler 'api.py'.
In that api controller I have several functions, all with the 
'@request.restful()' decorator. Inside each of them I import a module and 
from the modules logic code is executed (all the DAL manipulations). Then 
json data is returned.
I does work very well :)

For the angular views (directives or ui-router), if I can manage to have 
all the processing done on the server I try to do that first. 
Angular *views*:
I call the controller/function as usual and return a dict() with any server 
processing.

Angular *templates*:
I call a 'templates.py' controller with different functions (corresponding 
to angular modules). According to the args passed to the function I change 
the 'response.view' and get all the web2py Views magic (DAL and T mainly 
for now. Maybe SQLForm once I dive in the LOAD() method). If I don't need 
any server processing I load a template from the static folder (if needed I 
call the api above to fetch some data).

If I am not wrong, each 'hit' to the api.py controller is the same as a 
full page reload, from the web2py perspective. Am I correct?

Thanks for all the insights
Sébastien.
  

On Thursday, 16 April 2015 02:46:08 UTC+2, Richard wrote:

 Ok, you are right... I only said that as long as that page not reload and 
 he call web2py functions which are not requesting a new page load it will 
 reduce the amount of server side processing since the function call will 
 have limited web2py API call...

 Richard

 On Wed, Apr 15, 2015 at 6:35 PM, Niphlod nip...@gmail.com javascript: 
 wrote:

 this is the uttmost unproper and biased statement I've seen in a while. 
 Angular doesn't make your app fast by default, and neither snappier, and 
 neither more resource-friendly on the server. If you're good with Angular 
 you're just pushing your logic client-side, and avoiding page reloads. This 
 doesn't impact performances AT ALL on the server-side.
 BTW: Hopefully you're not pushing your entire smart code bits of the 
 app client-side, either it'll be copied away in a split second. If your 
 assumptions are that moving the UI and unimportant parts of your app to the 
 client makes your backend faster...well, you have too much unimportant 
 code in your app.

 On Thursday, April 16, 2015 at 12:02:12 AM UTC+2, Richard wrote:

 Wait if you use Angular you won't really need to care about performance 
 issue before a lot of time... Since you are not going to experiment be 
 performance issue except when you reload page...

  -- 
 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 Groups 
 web2py-users group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to web2py+un...@googlegroups.com javascript:.
 For more options, visit https://groups.google.com/d/optout.




-- 
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 Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] How to read latin encoded characters correctly from MSSQL?

2015-04-17 Thread Carlos Costa
Whe I use pyodbc only, I can read and convert characters correctly.
But always replace accentuated characters with '?'.

I already tried the db_codec='cp1252' and db_codec='latin1' attribute in 
DAL.
In fact, MSSQL uses its own collation: sql_latin1_general_cp1_ci_as as 
collation.
But both latin1 and cp1252 work fine with pyodbc only by simply 
doing row[0].decode('cp1252') for example.

I also tried to use filter_out and SQLCustomType but they receive tha value 
already decoded wrong.

Any other thing may I be missing beyond hack DAL?

-- 
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 Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Stackless/threading Python

2015-04-17 Thread Abdul Hakeem
Hello,
Can anyone suggest how to setup Web2Py using Stakckless Python ?.
Best regards,
Abdul Hakeem

-- 
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 Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: WEB2PY Certificate ?

2015-04-17 Thread KPlusPlus
Well , Since all of you liked the idea , how could we apply it in the real 
world ?
Do we need to license/Certify the instructors so they can start running 
web2py course in their  institutions ?
or we have a better solution ?


On Thursday, April 16, 2015 at 8:50:13 PM UTC+3, Ron Chatterjee wrote:

 You have my vote on it. It it matters. lol

 On Wednesday, April 15, 2015 at 9:32:35 AM UTC-4, Massimo Di Pierro wrote:

 This is an excellent idea.

 On Friday, 10 April 2015 23:00:40 UTC-5, KPlusPlus wrote:

 Can we start the same initiative around the world for the educational 
 institutions ,  where the institution can be recognized  by web2py ? 


 On Friday, April 10, 2015 at 10:41:56 AM UTC+3, Mariano Reingart wrote:

 FYI, in Argentina we're starting a similar initiative, Diploma in Free 
  Open Source Software in a local university (Spanish language): 

 http://www.softwarelibre.org.ar/diplomatura/


 http://www.ude.edu.ar/index.php?option=com_contentview=articleid=615Itemid=55

 It is more extensive, the courses are:

- Web development (web2py)
- Introduction to programming I  II (Python)
- Databases (PostgreSQL)
- Computer Networks (GNU/Linux)
- Operating Systems (GNU/Linux)
- Free  Open Source Software introduction 
- Free  Open Source Software Engineering

 I'd be glad to help automating / translating an unified certification 
 process for web2py ;-) 

 BTW, teaching assistants collaborators are welcome too (feel free to 
 contact me by private email)

 Best regards

 Mariano Reingart
 http://www.sistemasagiles.com.ar
 http://reingart.blogspot.com


 On Tue, Mar 24, 2015 at 4:34 AM, Massimo Di Pierro 
 massimo@gmail.com wrote:
  Yes.
  
 http://www.cdm.depaul.edu/ipd/Programs/Pages/WebDevelopmentwithPython.aspx
 
  I teach it and it is basically a course on web2py. Problem is, I am 
 too busy
  to teach it and I have not been teaching it in one year.
 
  Anyway, past lectures are all online. I am considering automating the
  certification process. I have a large database of questions/problems.
 
  Massimo
 
 
  On Monday, 23 March 2015 21:53:16 UTC-5, KPlusPlus wrote:
 
  Hello
 
  I was wondering if there's an organization/institution can offer a 
 WEB2PY
  Certificate with or without Course ?
 
  --
  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 
 Groups
  web2py-users group.
  To unsubscribe from this group and stop receiving emails from it, 
 send an
  email to web2py+un...@googlegroups.com.
  For more options, visit https://groups.google.com/d/optout.



-- 
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 Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] SQLFORM, add field with button

2015-04-17 Thread KevC
Hi community.
I want to know if you could help me. I started to use web2py, but I don't 
know some things. I want to create fields with a button on SQLFORM and HTML.
For example, I have author table and book table, but a book can get several 
authors and I need to create differents INPUT on the FORM for save them 
with book and his fields.
I have a relation many to many between book and author. Also I combine both 
FORM´s (author and book).

I wanna this FORM

Title:   |__
Author:|__ + -   (Where '+' I wanna use it to add more 
authors in the same FORM and '-' to remove fields if I mistake.
Languaje:|__
ISBN: |__
Etc.




Greetings.

-- 
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 Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Web2Py compute fields not working on update

2015-04-17 Thread Ian Ryder
Same problem here - all works fine but am using an after_update callback on 
a child record but the compute doesn't work when the parent record values 
are updated. 


On Tuesday, June 19, 2012 at 2:24:05 AM UTC+10, Brandon Reynolds wrote:

 I have this problem when i try to generate thumbnails. If the field is 
 empty it inserts the photo thumb into the thumbnail. But when i try to 
 update that record the thumbnail doesn't change. 

 Here is my model:

 # coding: utf8
 from image import THUMBER

 db.define_table('park', 
 Field('park_name', requires=IS_NOT_EMPTY()),
 Field('park_city', requires=IS_NOT_EMPTY()),
 Field('park_state', requires=IS_NOT_EMPTY()),
 Field('park_address', requires=IS_NOT_EMPTY()),
 Field('park_zip', requires=IS_NOT_EMPTY()),
 Field('country', default=USA, notnull=True, readable=False, 
 writable=False),
 Field('park_phone', requires=IS_MATCH('[\d\-\(\) ]+')),
 Field('park_fax', requires=IS_EMPTY_OR(IS_MATCH('[\d\-\(\) ]+'))),
 Field('park_phone_2', 'string', requires=IS_EMPTY_OR(IS_MATCH('[\d\-\(\) 
 ]+'))),
 Field('photo1', 'upload'),
 Field('photo_thumb1', 'upload', readable=False, writable=False),
 Field('photo2', 'upload'),
 Field('photo_thumb2', 'upload', readable=False, writable=False),
 Field('photo3', 'upload'),
 Field('photo_thumb3', 'upload', readable=False, writable=False),
 Field('photo4', 'upload'),
 Field('photo_thumb4', 'upload', readable=False, writable=False),
 Field('photo5', 'upload'),
 Field('photo_thumb5', 'upload', readable=False, writable=False),
 Field('manager', requires=IS_NOT_EMPTY()),
 Field('manager_email', requires=IS_EMAIL()),
 Field('spaces', 'integer', requires=IS_NOT_EMPTY()),
 Field('vacant', 'integer'),
 Field('lot_rent', 'integer', requires=IS_NOT_EMPTY()),
 Field('water', 'boolean'),
 Field('sewer', 'boolean'),
 Field('trash', 'boolean'),
 Field('pool', 'boolean'),
 Field('playground', 'boolean'),
 Field('clubhouse', 'boolean'),
 Field('laundromat', 'boolean'),
 Field('rv_spaces', 'boolean'),
 Field('storage', 'boolean'),
 Field('handicap_accessible', 'boolean'),
 Field('community_description', 'text'),
 format='%(park_name)s')

 db.define_table('home', 
 Field('pid', notnull=True, readable=False, writable=False),
 Field('lot'),
 Field('year', length=4, requires=IS_NOT_EMPTY()),
 Field('make'),
 Field('model'),
 Field('width', requires=IS_NOT_EMPTY()),
 Field('length', requires=IS_NOT_EMPTY()),
 Field('wide', requires=IS_NOT_EMPTY()),
 Field('for_sale', 'boolean', default=True),
 Field('beds', requires=IS_NOT_EMPTY()),
 Field('baths', requires=IS_NOT_EMPTY()),
 Field('fridge', 'boolean'),
 Field('stove', 'boolean'),
 Field('dishwasher', 'boolean'),
 Field('microwave', 'boolean'),
 Field('washer', 'boolean'),
 Field('dryer', 'boolean'),
 Field('photo1', 'upload'),
 Field('photo1_text'),
 Field('photo_thumb1', 'upload', readable=False, writable=False),
 Field('photo2', 'upload'),
 Field('photo2_text'),
 Field('photo_thumb2', 'upload', readable=False, writable=False),
 Field('photo3', 'upload'),
 Field('photo3_text'),
 Field('photo_thumb3', 'upload', readable=False, writable=False),
 Field('photo4', 'upload'),
 Field('photo4_text'),
 Field('photo_thumb4', 'upload', readable=False, writable=False),
 Field('photo5', 'upload'),
 Field('photo5_text'),
 Field('photo_thumb5', 'upload', readable=False, writable=False),
 Field('price',requires=IS_NOT_EMPTY()),
 Field('description', 'text', requires=IS_NOT_EMPTY()),
 Field('posted_on', 'datetime', readable=False, writable=False))

 db.define_table('state',
 Field('name'),
 Field('full_name'))

 db.define_table('wide',
 Field('type'),
 format='%(type)s')


 db.park.park_state.requires = IS_IN_DB(db, 'state.name', '%(full_name)s 
 (%(name)s)', zero=T('Select State'))
 db.home.wide.requires = IS_IN_DB(db, 'wide.type', '%(type)s', 
 zero=T('Select Home Type'))

 db.park.photo_thumb1.compute = lambda row: THUMBER(row.photo1, 
 photo_thumb1, 144, 115)
 db.park.photo_thumb2.compute = lambda row: THUMBER(row.photo2, 
 photo_thumb2, 144, 115)
 db.park.photo_thumb3.compute = lambda row: THUMBER(row.photo3, 
 photo_thumb3, 144, 115)
 db.park.photo_thumb4.compute = lambda row: THUMBER(row.photo4, 
 photo_thumb4, 144, 115)
 db.park.photo_thumb5.compute = lambda row: THUMBER(row.photo5, 
 photo_thumb5, 144, 115)
 db.home.photo_thumb1.compute = lambda row: THUMBER(row.photo1, 
 photo_thumb1, 144, 115)
 db.home.photo_thumb2.compute = lambda row: THUMBER(row.photo2, 
 photo_thumb2, 144, 115)
 db.home.photo_thumb3.compute = lambda row: THUMBER(row.photo3, 
 photo_thumb3, 144, 115)
 db.home.photo_thumb4.compute = lambda row: THUMBER(row.photo4, 
 photo_thumb4, 144, 115)
 db.home.photo_thumb5.compute = lambda row: THUMBER(row.photo5, 
 photo_thumb5, 144, 115)


 Here is my controller:

 def index():
 return locals()
 
 def parks():
 if request.args(0):
 parks = 
 db(db.park.park_state==request.args(0)).select(orderby=db.park.park_city|db.park.park_name)
 else:
 parks = 
 

[web2py] Creating dynamic feedback

2015-04-17 Thread Andrea Baric
I am trying to create an application that mirrors a multiple choice test 
with just one question per page. How do I check for the correct answer and 
generate instant visual feedback--right or wrong-- after a user has 
submitted his or her answer (via a radio button)?

-- 
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 Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: How to write dynamic part of a select?

2015-04-17 Thread Sébastien Loix
One last thing, any idea if it is also possible to dynamically add 
left=[.], orderby=

For now I can't as it (logically) tells me that 'append() takes no keyword 
arguments'

thank you! 

On Wednesday, 15 April 2015 00:52:53 UTC+2, Limedrop wrote:

 You can do this by building a list of fields and then using the python 
 unpack operator.  For example:

 field_list = [db.auth_user.first_name]
 if ask_for_lastname:
 field_list.append(db.auth_user.last_name)
 rows = db(query).select(*field_list)

 See 
 https://docs.python.org/2/tutorial/controlflow.html#unpacking-argument-lists



-- 
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 Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Add field with button on SQLFORM

2015-04-17 Thread KevC
Hi community!
Good afternoon, my name is Kevin. 
I want to know if you could help me. I started to use web2py, but I don't 
know some things. 
I want to create fields with a button on SQLFORM and HTML. For example, I 
have author table and book table, but a book can get several authors and I 
need to create differents INPUT for save them with book and his fields.
I have a relation many to many between book and author. Also, I have 
combined author and book FORM´s.


I wanna this form:


Title: |___
Name author: |___ + -(Where '+', I wanna use it for add more 
authors in the same form and save them in his respective tables and '-' use 
it for remove fields If I mistake)
Lenguaje:  |
ISBN:   |
Etc.




I hope you can help me.
Greetings.

-- 
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 Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] routes.py breaking login...

2015-04-17 Thread Tom Stratton
Hi -

I wanted to change my default application and did some research.

First I did the simple:
```
default_application='p'
default_controller = pkg
default_function = packages
```
And it seemed to work fine but I was not satisfied so I did this:
```
routers = dict(
  BASE  = dict(default_application='p', default_controller='pkg'),
)
```

This seemed to work fine too - BUT… Then my login session expired and I see 
this URL:
https://bsttemp.pythonanywhere.com/default/user/login?_next=/packages

How can I make the login happen at my preferred controller instead of in 
the default one? (I had deleted the default.py controller after my limited 
testing worked)

Thanks

Tom

-- 
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 Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Issue with lookup foreign key / format statement in 2.10.3

2015-04-17 Thread Massimo Di Pierro
No tomorrow.

On Wednesday, 15 April 2015 13:10:28 UTC-5, Dave S wrote:



 On Tuesday, April 14, 2015 at 2:29:48 PM UTC-7, Niphlod wrote:

 being a bug, we need to ship a new web2py. it got fixed already. we're 
 waiting for Massimo to release a 2.10.4.


 Is that fix included in the nightly builds yet?
  
 /dps


 On Tuesday, April 14, 2015 at 10:51:31 PM UTC+2, wish...@gmail.com wrote:

 I just discovered, there's already a issue posted..

 https://groups.google.com/forum/#!topic/web2py/Tog4tdUl400
 https://github.com/web2py/web2py/issues/904 

 Are there already any solutions yet?

 Thanks  cheers
 Toby

 wish...@gmail.com:

 Hey guys!

 Did 2.10.3-stable+timestamp.2015.04.02.21.42.07 change something in the 
 way* format statements *%(fields)s are handled?

 When referencing another table, the *format statement now seems to be 
 ignored*. Instead only the foreign key id is displayed.

 Example 

 I have the following lookup table

 db.define_table('countries',
 Field('country', 'string'),
 Field('the_geom', 'geometry()'),
 Field.Virtual('latitude', lambda row: db(db.countries.id == 
 row.countries.id
 ).select(db.countries.centroid.st_y()).first()[db.countries.centroid.st_y()]),
 Field.Virtual('longitude', lambda row: db(db.countries.id == 
 row.countries.id
 ).select(db.countries.centroid.st_x()).first()[db.countries.centroid.st_x()]),
* format='%(country)s'*, migrate=True)
 
 Another table is referencing this lookup table

 db.define_table('uploads',
 Field('country',* db.countries*),
 Field('uploaded','date'),
 ...
 migrate=True)
 
 Now I would like to count the number of uploads per country.

 def count_uploads_by_country():
 import datetime
 from datetime import timedelta
 count = db.wifi_zone.id.count()
 result = db(db.uploads.uploaded  datetime.date.today() -  
 timedelta(days=7)).select(*db.uploads.country*, count, groupby = 
 db.uploads.country).render()
 return dict(result=result)
 
 I would expect that a query on the uploads table would display the 
 country name as specified in the format statement, i.e.
 *Country  Uploads per Country*
 *France* 123
 *Italy   *45 
 *Germany   *10

 Until recently this worked perfectly, but following the update to 
 2.10.3 only the country ids are returned, i.e.

 *Country  Uploads per Country**1*   -- foreign id instead of name
 *2*   --45 
 *3*   --10

 db._lastsql shows that the country name isn't even queried:
 SELECT uploads.country, COUNT(uploads.id) FROM uploads WHERE 
 (uploads.last_updated  '2015-04-04') GROUP BY uploads.country;

 Does anybody have a clue, why only the foreign id is displayed, but not 
 the country name according to the format statement?

 Cheers 
 Toby



-- 
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 Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Ractive example

2015-04-17 Thread Massimo Di Pierro
No. That simply decides wheher to display the login menu. 

On Thursday, 16 April 2015 13:41:03 UTC-5, Richard wrote:

 Hello Massimo,

 Are you really consider leaving authentication filtering of page elements 
 to ractive ({{#if (auth  auth.user)}} ...)?

 Richard

 On Wed, Apr 15, 2015 at 3:44 PM, Richard ml.richard.vez...@gmail.com 
 wrote:

 If I understand to style and create a semantic ui form style I would have 
 to create new layout and form template?

 forms.bs3.html - forms.semntaic-ui.html

 ?

 Richard


 Le mercredi 15 avril 2015 15:30:40 UTC-4, Richard a écrit :

 Hello Massimo,

 I am looking at w3 right now... I have been able to make it works... I 
 would like to know how your plan to integrate this into web2py... What it 
 needs to be consider relatively stable for user to use it... Does your 
 experiment is sufficiently well thought, it could be generalize and include 
 in web2py core? Or could we start working on this bleeding edge concept to 
 get away from server side form?

 I am want to help as much as I can in the coming days to make this in 
 web2py core somehow soon...

 I will look to let someone use semantic ui as you point where we can 
 help...

 Thanks

 Richard

 Le samedi 28 mars 2015 12:17:35 UTC-4, Massimo Di Pierro a écrit :

 yes it is orthogonal. In fact it uses very little of web2py, almost 
 exclusively the DAL and marginally the web2py template language. 

 On Thursday, 26 March 2015 02:48:05 UTC-5, Tim Richardson wrote:



 On Tuesday, 24 March 2015 13:55:25 UTC+11, Massimo Di Pierro wrote:

 Please look into this: https://github.com/mdipierro/w3
 I could very much use your opinions. I am working on it actively 
 these days.



 Massimo,
 the w3 'project': it seems to be orthogonal to bootstrap3 support, so 
 in other words any widget changes won't have anything to do with ractive 
 support?
 I'm a bit confused about the ambition for the use of ractive.
 tim

  -- 
 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 Groups 
 web2py-users group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to web2py+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.




-- 
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 Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Ractive example

2015-04-17 Thread Massimo Di Pierro
yes.

On Wednesday, 15 April 2015 14:44:27 UTC-5, Richard wrote:

 If I understand to style and create a semantic ui form style I would have 
 to create new layout and form template?

 forms.bs3.html - forms.semntaic-ui.html

 ?

 Richard

 Le mercredi 15 avril 2015 15:30:40 UTC-4, Richard a écrit :

 Hello Massimo,

 I am looking at w3 right now... I have been able to make it works... I 
 would like to know how your plan to integrate this into web2py... What it 
 needs to be consider relatively stable for user to use it... Does your 
 experiment is sufficiently well thought, it could be generalize and include 
 in web2py core? Or could we start working on this bleeding edge concept to 
 get away from server side form?

 I am want to help as much as I can in the coming days to make this in 
 web2py core somehow soon...

 I will look to let someone use semantic ui as you point where we can 
 help...

 Thanks

 Richard

 Le samedi 28 mars 2015 12:17:35 UTC-4, Massimo Di Pierro a écrit :

 yes it is orthogonal. In fact it uses very little of web2py, almost 
 exclusively the DAL and marginally the web2py template language. 

 On Thursday, 26 March 2015 02:48:05 UTC-5, Tim Richardson wrote:



 On Tuesday, 24 March 2015 13:55:25 UTC+11, Massimo Di Pierro wrote:

 Please look into this: https://github.com/mdipierro/w3
 I could very much use your opinions. I am working on it actively these 
 days.



 Massimo,
 the w3 'project': it seems to be orthogonal to bootstrap3 support, so 
 in other words any widget changes won't have anything to do with ractive 
 support?
 I'm a bit confused about the ambition for the use of ractive.
 tim



-- 
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 Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: WEB2PY Certificate ?

2015-04-17 Thread Ron Chatterjee
Would be nice to have a web framework course work but who will teach it or 
will pay to develop the course? But I just want to add, certification is 
not looked at very respectfully in the industry. I know I will get attached 
for this comment I am making. But lets say you try to get a job at google 
or apple. If someone say they are certified, they will careless. Depends on 
the industry ofc. I don't care about the title. I only care about the 
content and what I can learn from it. but that just me:-) 

On Friday, April 17, 2015 at 10:50:36 PM UTC-4, KPlusPlus wrote:

 Well , Since all of you liked the idea , how could we apply it in the real 
 world ?
 Do we need to license/Certify the instructors so they can start running 
 web2py course in their  institutions ?
 or we have a better solution ?


 On Thursday, April 16, 2015 at 8:50:13 PM UTC+3, Ron Chatterjee wrote:

 You have my vote on it. It it matters. lol

 On Wednesday, April 15, 2015 at 9:32:35 AM UTC-4, Massimo Di Pierro wrote:

 This is an excellent idea.

 On Friday, 10 April 2015 23:00:40 UTC-5, KPlusPlus wrote:

 Can we start the same initiative around the world for the educational 
 institutions ,  where the institution can be recognized  by web2py ? 


 On Friday, April 10, 2015 at 10:41:56 AM UTC+3, Mariano Reingart wrote:

 FYI, in Argentina we're starting a similar initiative, Diploma in 
 Free  Open Source Software in a local university (Spanish language): 

 http://www.softwarelibre.org.ar/diplomatura/


 http://www.ude.edu.ar/index.php?option=com_contentview=articleid=615Itemid=55

 It is more extensive, the courses are:

- Web development (web2py)
- Introduction to programming I  II (Python)
- Databases (PostgreSQL)
- Computer Networks (GNU/Linux)
- Operating Systems (GNU/Linux)
- Free  Open Source Software introduction 
- Free  Open Source Software Engineering

 I'd be glad to help automating / translating an unified certification 
 process for web2py ;-) 

 BTW, teaching assistants collaborators are welcome too (feel free to 
 contact me by private email)

 Best regards

 Mariano Reingart
 http://www.sistemasagiles.com.ar
 http://reingart.blogspot.com


 On Tue, Mar 24, 2015 at 4:34 AM, Massimo Di Pierro 
 massimo@gmail.com wrote:
  Yes.
  
 http://www.cdm.depaul.edu/ipd/Programs/Pages/WebDevelopmentwithPython.aspx
 
  I teach it and it is basically a course on web2py. Problem is, I am 
 too busy
  to teach it and I have not been teaching it in one year.
 
  Anyway, past lectures are all online. I am considering automating the
  certification process. I have a large database of questions/problems.
 
  Massimo
 
 
  On Monday, 23 March 2015 21:53:16 UTC-5, KPlusPlus wrote:
 
  Hello
 
  I was wondering if there's an organization/institution can offer a 
 WEB2PY
  Certificate with or without Course ?
 
  --
  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 
 Groups
  web2py-users group.
  To unsubscribe from this group and stop receiving emails from it, 
 send an
  email to web2py+un...@googlegroups.com.
  For more options, visit https://groups.google.com/d/optout.



-- 
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 Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Setup.py

2015-04-17 Thread Massimo Di Pierro
It is very well possible that it does not work. Somebody should adopt it.

On Friday, 17 April 2015 15:05:37 UTC-5, AngeloC wrote:

 Hello List, 

 I'm trying to understand how setup.py works. It seems to me that it 
 doesn't work. 

 There is no web2py binary in system path or somewhere else. 

 It's a bug or feature? 

 Thank you! 

 Sincerely, Angelo 

 -- 
 Profile: http://it.linkedin.com/in/compagnucciangelo 


-- 
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 Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: type 'exceptions.AttributeError' 'module' object has no attribute 'items'

2015-04-17 Thread Massimo Di Pierro
Yes. That is a patch gone bad. We are working on fixing it.

On Friday, 17 April 2015 09:32:27 UTC-5, Dimid Duchovny wrote:

 Hello,

 I get this error right after cloning:

 git clone --recursive https://github.com/web2py/web2py.git
 [snip]
 cd web2py/
 python web2py.py
 ERROR:root:New installation error: unable to create welcome.w2p file
 web2py Web Framework
 Created by Massimo Di Pierro, Copyright 2007-2015
 Version 2.10.3-stable+timestamp.2015.04.02.16.28.49
 Database drivers available: pymysql, imaplib, pg8000, sqlite3, sqlite2, 
 pyodbc, mysqlconnector
 please visit:
 http://127.0.0.1:8000/
 starting browser...
 unnamed app(3684) ClientApp::doIt: Creating ClientApp
 kioclient(3684) ClientApp::kde_open: KUrl(http://127.0.0.1:8000/;)
 kioclient(3684) KSharedUiServerProxy::KSharedUiServerProxy: kuiserver 
 registered


 commit f33ccf3366bc19c8

 In the browser, visiting http://127.0.0.1:8000 and opening the ticket:
 Error ticket for welcomeTicket ID

 127.0.0.1.2015-04-17.15-40-48.2e727d5f-799a-4402-bc0e-0ced3b8f013b
 type 'exceptions.AttributeError' 'module' object has no attribute 
 'items'
 Versión  
 web2py™Version 2.10.3-stable+timestamp.2015.04.02.16.28.49PythonPython 2.7
 .6: /usr/bin/python (prefix: /usr)

 Rastreo

 1.
 2.
 3.
 4.
 5.
 6.
 7.
 8.
 9.
 10.
 11.

 Traceback (most recent call last):
   File /home/dimid/web2py/gluon/restricted.py, line 227, in restricted
 exec ccode in environment
   File /home/dimid/web2py/applications/welcome/models/db.py 
 http://127.0.0.1:8000/admin/default/edit/welcome/models/db.py, line 20, in 
 module
 db = DAL(myconf.take('db.uri'), pool_size=myconf.take('db.pool_size', 
 cast=int), check_reserved=['all'])
   File /home/dimid/web2py/gluon/packages/dal/pydal/base.py, line 171, in 
 __call__
 obj = super(MetaDAL, cls).__call__(*args, **kwargs)
   File /home/dimid/web2py/gluon/packages/dal/pydal/base.py, line 475, in 
 __init__
 for k, v in self.serializers.items():
 AttributeError: 'module' object has no attribute 'items'





-- 
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 Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: using pydal to connect to app in standalone mode

2015-04-17 Thread Ron Chatterjee
Found the issue:

Its about having the folder location in windows way as oppose to 
linux/unix. If I use fwd slash, instead backwards. It works.

Sorry.


On Friday, April 17, 2015 at 10:33:11 PM UTC-4, Massimo Di Pierro wrote:

 This should be possible. This is the purpose of pydal. Perhaps the file 
 truly corrupted or the folder is missing/incorrect?

 On Friday, 17 April 2015 17:47:42 UTC-5, Ron Chatterjee wrote:


 from pydal import DAL, Field


 db = 
 DAL('sqlite://storage.sqlite',folder='C:\web2py\applications\my_app_name\databases',auto_import=True);

 in my application models/db.py I have my database definition.

 I can't connect through pydal. I get an error:

   return self.driver.Connection(dbpath, **driver_args)
 OperationalError: unable to open database file


 Am I missing something? Basically trying to use pydal as a standalone to 
 load existing database. If it is even possible.  



-- 
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 Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.