[web2py] Re: Referencing user results in syntax-error?

2012-07-27 Thread Alec Taylor
On Friday, July 27, 2012 6:45:04 AM UTC+10, Massimo Di Pierro wrote: Person cannot be not null and default to auth.user_id which likely is null. It also cannot defaul to auth.user. Use the second line and remove notnull Thanks, but that gave me the same error. Full ticket:

[web2py] Can't run web2py because of socket.gethostbyname problem

2012-07-27 Thread pbreit
This change is preventing me from starting web2py because of a problem with socket.gethostbyname(): http://code.google.com/p/web2py/source/detail?r=36139e7a6c9c14983e0d09f626959beb8fcf9320 I'm on a Mac where I'm not exactly sure how hostnaming works. socket.getfqdn() is returning some weird

[web2py] Getting error: type 'exceptions.ImportError' DLL load failed: The operating system cannot run %1

2012-07-27 Thread Amit
I Have installed python 2.7.2 and M2Crypto-0.21.1-py2.7.egg-info in my Windows XP SP3 machine and wherever i am using import statement: from M2Crypto import X509,ASN1,Rand,EVP,RSA its throwing error * DLL load failed: The operating system cannot run %1.* it seems like M2Crypto version is

[web2py] Re: Referencing user results in syntax-error?

2012-07-27 Thread Niphlod
Massimo is right, but you're having the error for another reason. it's plain and clear (*Variables* section). You are also lucky that in all of this statement there is only one dot. ('ALTER TABLE rsvp_list ADD event_id INTEGER REFERENCES db.event (id) ON DELETE CASCADE;',) you have

[web2py] Re: Puzzle: reference table not working?

2012-07-27 Thread lyn2py
That was simple. Feeling quite stupid that I missed it. Thanks Anthony! On Thursday, July 26, 2012 10:01:41 PM UTC+8, Anthony wrote: db.define_table('person', Field('name','string',length=255,requires=IS_NOT_EMPTY()), Field('location_id','reference location',default=location.id), )

Re: [web2py] Getting error: type 'exceptions.ImportError' DLL load failed: The operating system cannot run %1

2012-07-27 Thread Amit
Found the problem :), I was using wrong version of M2Crypto so uninstalled it and install M2Crypto-0.20.2.win32-py2.7 version and its working fine. On Fri, Jul 27, 2012 at 12:02 PM, Amit amit.khaw...@gmail.com wrote: I Have installed python 2.7.2 and M2Crypto-0.21.1-py2.7.egg-info in my

[web2py] render rows into bootstrap navbar with dropdown menus

2012-07-27 Thread Annet
The following rows are the result of a query: idname controllerfunction parentID 1home site index 0 2about about index 0 3who_we_areabout whoWeAre 2 4

[web2py] Add dict to SERIALIZABLE_TYPES in Row object's as_dict method

2012-07-27 Thread Omri Har-Shemesh
I recently defined a pickled SQLCustomType field for automatic dumping/loading of inserted types to the field. The definition is: pickled = SQLCustomType( type = 'text', native = 'text', encoder = (lambda x: pickle.dumps(x)), decoder = (lambda x: pickle.loads(x)) ) I use it to store

Re: [web2py] Re: Referencing user results in syntax-error?

2012-07-27 Thread Alec Taylor
Thanks, that did the trick. On Fri, Jul 27, 2012 at 5:25 PM, Niphlod niph...@gmail.com wrote: Massimo is right, but you're having the error for another reason. it's plain and clear (*Variables* section). You are also lucky that in all of this statement there is only one dot. ('ALTER TABLE

[web2py] Scheduler and trying to insert task with args

2012-07-27 Thread MJo
If I provide args like following: ... my_id = db.my_inventory.insert(...) db.scheduler_task.insert( ... args=dumps(['my_id']), ...) ... I see exactly this 'my_id' as textual string on my newly created task, looking it via appadmin. How to make my task to get numerical data to be able to do

[web2py] Re: Scheduler and trying to insert task with args

2012-07-27 Thread MJo
Oh I'm using trunk something like one week old to that matter. On Friday, July 27, 2012 3:52:03 PM UTC+3, MJo wrote: If I provide args like following: ... my_id = db.my_inventory.insert(...) db.scheduler_task.insert( ... args=dumps(['my_id']), ...) ... I see exactly this 'my_id' as

Re: [web2py] Re: Scheduler and trying to insert task with args

2012-07-27 Thread Marin Pranjić
Hi, shouldn't you remove the 'quotes'? Marin On Fri, Jul 27, 2012 at 2:54 PM, MJo mika.e.joukai...@gmail.com wrote: Oh I'm using trunk something like one week old to that matter. On Friday, July 27, 2012 3:52:03 PM UTC+3, MJo wrote: If I provide args like following: ... my_id =

[web2py] Re: Can't run web2py because of socket.gethostbyname problem

2012-07-27 Thread Massimo Di Pierro
Fixed in trunk now. On Friday, 27 July 2012 01:16:30 UTC-5, pbreit wrote: This change is preventing me from starting web2py because of a problem with socket.gethostbyname(): http://code.google.com/p/web2py/source/detail?r=36139e7a6c9c14983e0d09f626959beb8fcf9320 I'm on a Mac where I'm not

[web2py] Re: Add dict to SERIALIZABLE_TYPES in Row object's as_dict method

2012-07-27 Thread Massimo Di Pierro
Send me a patch and I will take a look. It is probably safe. On Friday, 27 July 2012 06:30:54 UTC-5, Omri Har-Shemesh wrote: I recently defined a pickled SQLCustomType field for automatic dumping/loading of inserted types to the field. The definition is: pickled = SQLCustomType( type =

[web2py] Signed URLs - is this understanding correct?

2012-07-27 Thread lyn2py
I want to create a protected folder containing file uploads, which can only be accessed selectively (different set of files for different users, depending on their permissions). They should not be able to access it even if they have the direct link. Can I (or should I) do this using digitally

Re: [web2py] Re: Can't run web2py because of socket.gethostbyname problem

2012-07-27 Thread Jonathan Lundell
On 27 Jul 2012, at 7:32 AM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Fixed in trunk now. One thing I found via Stack Overflow is that the old IPv6 configuration option of 'Off' is now gone, except that it's sticky from previous configurations. Some of these problems are apparently

[web2py] Re: Signed URLs - is this understanding correct?

2012-07-27 Thread Massimo Di Pierro
No this is not what signed urls are for. Signed urls are for delegating access control from one controller action to another. Consider this code: @auth.requires_membership('admin'): def index() link = URL('other') return dict(link=link) @auth.requires_membership('admin'): def other():

[web2py] Again: how redirect without propagate the .load extension?

2012-07-27 Thread Martin Weissenboeck
From the book: *If you LOAD a component having the .load extension and the corresponding controller functionredirects to another action (for example a login form), the .load extension propagates and the new url (the one to redirect too) is also loaded with a .load extension. * I have a chain

Re: [web2py] Again: how redirect without propagate the .load extension?

2012-07-27 Thread Bruno Rocha
put extension=False in URL redirect(URL('index2',extension='html',vars={'text':request.vars.text}, extension=False)) --

Re: [web2py] Again: how redirect without propagate the .load extension?

2012-07-27 Thread Martin Weissenboeck
I have tried: redirect(URL('index2',vars={'text':request.vars.text}, extension=False)) Sorry, the same result - index2 is loaded. 2012/7/27 Bruno Rocha rochacbr...@gmail.com put extension=False in URL redirect(URL('index2',extension='html',vars={'text':request.vars.text}, extension=False))

Re: [web2py] Again: how redirect without propagate the .load extension?

2012-07-27 Thread Niphlod
I've not tested it, but there's a misunderstanding here I think. Say that URL() gets the extension from the current request if not specified is true. This is generally wanted because links in a LOADed portion of the frame must not contain the whole layout. But I think you want a LOADed form

Re: [web2py] Re: Scheduler and trying to insert task with args

2012-07-27 Thread MJo
Thank you that did the trick! (Tried enormous amount of combinations, but not all when started playing with dumps() ) On Friday, July 27, 2012 5:06:30 PM UTC+3, Marin Pranjić wrote: ... shouldn't you remove the 'quotes'? Marin --

Re: [web2py] Again: how redirect without propagate the .load extension?

2012-07-27 Thread Johann Spies
Hallo Martin, In stead of redirecting, I am using this script in the view: script type=text/javascript jQuery(document).ready(function() { jQuery($(:input:submit:last).addClass('gaanvoort')); jQuery($(input.gaanvoort).click(

Re: [web2py] Again: how redirect without propagate the .load extension?

2012-07-27 Thread Martin Weissenboeck
You have described my problem nearly perfect, with one difference: There is a path from index to sub1, from sub1 to sub2 and from sub2 to sub3, every step should use the LOAD-function. Every step adds some information. After the last step the whole information should be sent to index2 (using

Re: [web2py] Again: how redirect without propagate the .load extension?

2012-07-27 Thread Martin Weissenboeck
Hallo Johann, I have tried your proposal - yes, this workaround does the job and I think I will use it. But I am surprised that there is not simple solution. Or does nobody else want to get rid the load? 2012/7/27 Johann Spies johann.sp...@gmail.com Hallo Martin, In stead of redirecting, I

Re: [web2py] Again: how redirect without propagate the .load extension?

2012-07-27 Thread Massimo Di Pierro
I will take a patch. ;-) On Friday, 27 July 2012 16:54:51 UTC-5, mweissen wrote: Hallo Johann, I have tried your proposal - yes, this workaround does the job and I think I will use it. But I am surprised that there is not simple solution. Or does nobody else want to get rid the load?

[web2py] Re: field of type upload exceptions.UnboundLocalError

2012-07-27 Thread Massimo Di Pierro
I cannot reproduce the problem and I do not understand how it is possible that #2 is executed (with an error) but #1 is not (code below). I believe this is happening to you but I need your help figuring out why. I need to understand which is/elif are true in that code and what is the value of

Re: [web2py] markmin embed:http://... not work trunk version

2012-07-27 Thread Massimo Di Pierro
I think embed:http://url should be deprecated in MARKMIN. It think if a url is found and not marked-up whether or not prefixed with embed: the url should be precessed by the function gluon/contrib/autolinks.py/expand_one(url,{}) This function uses the oembed protocol to figure out the

[web2py] Using UUID in a many to many database

2012-07-27 Thread Mark Li
I currently have 3 data tables setup, one is an intermediate table linking a many to many relationship. I would like to use UUID as the reference ID, so I insert the uuid into the intermediate table instead of the normal ID. However this doesn't work as expected, all the fields in the

[web2py] Re: Using UUID in a many to many database

2012-07-27 Thread Massimo Di Pierro
You can't. References are always by ID. You can use the IS_IN_DB to show the UUID instead of the ID but the database will continue to use the ID. The presence of the UUID will be used by db.import_from_csv_file to fix references when importing records because it will build a temporary

Re: [web2py] uWSGI and routes.py

2012-07-27 Thread Massimo Di Pierro
Any news about this? Is the problem reproducible? Have you tried trunk? I suspect this may be a path issue and for some reason at startup web2py looks in the wrong place. @Jonathan, do you agree? Could you suggest a test to detect is this is the case? massimo On Sunday, 22 July 2012