Re: [web2py] Re: Error writing to session with latest Google App Engine 1.8.1

2013-07-05 Thread Aravindan Rs
hi cfh,

did you complete the move to the recent web2py version? does it solve the 
issue and work well with GAE version 1.8.1? i want to move now and any 
notes from you would be helpful.

thanks,
aravind.

On Saturday, 15 June 2013 06:18:06 UTC+5:30, Christian Foster Howes wrote:
>
> Yup, that change is why i'm upgrading web2py now.  Other GAE users have 
> reported issues with the recent web2py versions, and i think i found an 
> issue in the auth module when using custom table names.  I'll let you 
> know my results as i do my testing 
>
> cfh 
>
> On 6/14/13 17:33 , Aravindan Rs wrote: 
> > Thanks - I assume you are talking about the change from "class 
> > Reference(int)" to "class Reference(long)". Should work I think. 
> > Btw: This fix was done quite some time ago (on Jan 1st 2013 - 
> > 
> https://github.com/web2py/web2py/commit/dd3055836a3f8fbc5b06763710c369cab3f3fc40)
>  
>
> > - so patch might not be necessary. I'll move to latest web2py and check. 
> > 
> > Thanks again, 
> > Aravind. 
> > 
> > 
> > On Friday, 14 June 2013 20:16:41 UTC+5:30, Christian Foster Howes wrote: 
> >> 
> >> Aravind, 
> >> 
> >> I see that in trunk (and perhaps the latest web2py release) i think 
> that 
> >> this has been fixed.  Please make sure you are using the latest web2py 
> >> version.  I'm working on upgrading to the latest web2py version and 
> then 
> >> the latest GAE SDK to get things working for me.  There may be some 
> patches 
> >> coming, hopefully later today 
> >> 
> >> cfh 
> >> 
> >> On Thursday, June 13, 2013 2:15:46 AM UTC-7, Aravindan Rs wrote: 
> >>> 
> >>> Hi, 
> >>> 
> >>> I get the following error stack on login / logout when session object 
> is 
> >>> attempted to be written to the database: 
> >>> 
> >>> Traceback (most recent call last): 
> >>>File 
> "/base/data/home/apps/s~nittio-live/24.368055561930403768/gluon/main.py", 
> line 551, in wsgibase 
> >>>  session._try_store_in_db(request, response) 
> >>>File 
> "/base/data/home/apps/s~nittio-live/24.368055561930403768/gluon/globals.py", 
> line 728, in _try_store_in_db 
> >>>  record_id = table.insert(**dd) 
> >>>File 
> "/base/data/home/apps/s~nittio-live/24.368055561930403768/gluon/dal.py", 
> line 7806, in insert 
> >>>  ret =  self._db._adapter.insert(self,self._listify(fields)) 
> >>>File 
> "/base/data/home/apps/s~nittio-live/24.368055561930403768/gluon/dal.py", 
> line 4618, in insert 
> >>>  rid = Reference(tmp.key().id()) 
> >>> OverflowError: Python int too large to convert to C long 
> >>> 
> >>> 
> >>> 
> >>> I'm using Google App Engine - with python 2.7 and web2py. 
> >>> 
> >>> I have one version of application which was deployed yesterday - this 
> is 
> >>> still working (i.e. no such errors during login/logout). I deploy the 
> same 
> >>> code today and it does not work. This morning google sent a release 
> >>> announcement for google app engine 1.8.1. The change was related to 
> >>> scattered auto ID (64 bits). I'm guessing my problem could be due app 
> >>> engine change. 
> >>> 
> >>> Are others facing similar problem? Any known solutions? 
> >>> 
> >>> Warm Regards, 
> >>> Aravind. 
> >>> 
> >>> 
> >>> 
> > 
>

-- 

--- 
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/groups/opt_out.




[web2py] Re: Select table in drop down import the file and edit

2013-07-05 Thread Rohitraj Sharma
Sure i will work on that, and come back on you.

On Friday, 5 July 2013 19:49:43 UTC+5:30, Anthony wrote:
>
> web2py_component("{{=URL('default', 'form.load')}}" + "/" +
>   jQuery(this).val(), target='form')
>
> The above line will result in an ajax request being sent from the browser 
> when a selection is made. If you use the developer tools in the browser to 
> watch the network traffic, you should be able to observe that ajax call.
>
> As far as I can tell, your code works fine, so must be something wrong 
> with your set up. Maybe show the code for the main page and its view and 
> clarify exactly where the view code you have already shown resides.
>
> Anthony
>
> On Friday, July 5, 2013 12:58:47 AM UTC-4, Rohitraj Sharma wrote:
>>
>> No Anthony , i am loading as the main page. no same function. Actually i 
>> am not able to understand where i have to pass URL which u have shared.
>>
>> Thanks Anthony 
>>
>> On Thursday, 4 July 2013 20:59:46 UTC+5:30, Anthony wrote:
>>>
>>> On Thursday, July 4, 2013 2:59:17 AM UTC-4, Rohitraj Sharma wrote:
>>>
 http://127.0.0.1:8000/appname/default/form

>>>
>>> That can't be the URL requested by the browser via ajax -- it would be 
>>> of the form /appname/default/form.load/table_name. Is that the URL you are 
>>> loading as the main page in the browser? Is the view code you're showing 
>>> the view for the form() function? You should be loading the main page via a 
>>> separate function/view, and have that page make the ajax call to the form() 
>>> function. When I try your code with that approach, it works fine.
>>>
>>> Anthony
>>>
>>

-- 

--- 
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/groups/opt_out.




[web2py] Re: custom formstyles

2013-07-05 Thread Anthony
Yes, you can create a completely custom formstyle (everything that goes 
inside the  element) by specifying the "formstyle" argument as a 
callable. Here is an example of the formstyle function for the "bootstrap" 
formstyle: 
https://code.google.com/p/web2py/source/browse/gluon/sqlhtml.py#763.

Anthony

On Friday, July 5, 2013 8:32:02 PM UTC-4, Mark Finkelstein wrote:
>
> formstyles are great and all, but I was wondering if it was possible to 
> create a custom formstyle without waiting until the form is generated and 
> then setting necessary changes with elements or using custom form styling.

-- 

--- 
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/groups/opt_out.




[web2py] custom formstyles

2013-07-05 Thread Mark Finkelstein
formstyles are great and all, but I was wondering if it was possible to 
create a custom formstyle without waiting until the form is generated and 
then setting necessary changes with elements or using custom form styling.

-- 

--- 
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/groups/opt_out.




[web2py] Re: Controller function doesn’t presents the view page

2013-07-05 Thread LightDot
You also probably wanted

redirect(URL(c='default',f='segunda'))

without the .html in the name of the function. Besides this, I can only 
repeat the question others have put - what's in the view?

Regards,
Ales


On Friday, July 5, 2013 2:36:34 PM UTC+2, ric...@gmail.com wrote:
>
> Hello all,
>
> I’ve made a post before but did not receive any answers, so I will try to 
> explain my problem I little better hoping that someone knows the answer.
>
> I have a controller function the redirects to another one:
>
> def result2():
>
> print 'B'
>
> session.temparray2 = json.loads(request.body.read())
>
> print  session.temparray2
>
> redirect(URL(c='default',f='segunda.html'))
>
> return dict()
>
>  
>
> def segunda():
>
> print 'ccc'
>
> return dict()
>
>  
>
> I thought that, running result2() would present the segunda.html view to 
> the user, but instead it does not. The segunda() functions runs, because I 
> can see the printed ‘’ on python window, but no web page is presented. 
>  Any one knows why the 'default/segunda.html’ is not shown?
>
> Thank you in advance
>
> Ricardo
>
>  
>
>  
>

-- 

--- 
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/groups/opt_out.




Re: [web2py] Access db in module

2013-07-05 Thread Michele Comitini
You can try

db = current.globalenv['db']

but you can do simply

def __init__(self, db):
   self.db = db

and instantiate MyClass in your controller or model as:
 myobj = MyClass(db)

mic


2013/7/5 Remco K 

> Hi all,
>
> I have a class in modules from which i can't access the DB object. I have
> this:
>
> in models/db.py:
>
> db=DAL(uri, migrate=True)
> current.db = db
>
> And in modules/MyClass.py:
>
> from gluon import current
>
> class MyClass(object):
> def __init__(self):
> self.db = current.db
>
> But i still can't access the db object from within my class.
>
> The error i get is:
>
> AttributeError: 'thread._local' object has no attribute 'db'
>
> Can someone tell me how to use this in the right way?
>
> Thanks in advance!
> Remco
>
>  --
>
> ---
> 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/groups/opt_out.
>
>
>

-- 

--- 
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/groups/opt_out.




[web2py] Access db in module

2013-07-05 Thread Remco K
Hi all,

I have a class in modules from which i can't access the DB object. I have 
this:

in models/db.py:

db=DAL(uri, migrate=True)
current.db = db

And in modules/MyClass.py:

from gluon import current

class MyClass(object):
def __init__(self):
self.db = current.db

But i still can't access the db object from within my class.

The error i get is:

AttributeError: 'thread._local' object has no attribute 'db'

Can someone tell me how to use this in the right way?

Thanks in advance!
Remco

-- 

--- 
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/groups/opt_out.




[web2py] session id is set to none with login_bare

2013-07-05 Thread Vikas Gupta

The client is an adroid app. I am getting the session_id as none in this 
function

def myTestUserLoginFunc():

import json
import gluon.contrib.simplejson

import gluon.contrib.simplejson as sj 
data = sj.loads(request.body.read())

myemail=data['email']
mypassword=data['password']

logged_user=auth.login_bare(myemail, mypassword.encode('utf8'))


if (auth.is_logged_in() == True):
logger.debug("I am logged in.")
else:
logger.debug("I am not logged in.")

logger.debug("session.session_id = %s" %session.session_id)
logger.debug("response session id - %s " % response.session_id)
logger.debug("session file %s " % response.session_file_name)
logger.debug("session id name %s " % response.session_id_name)
logger.debug("session status %s " % response.session_status)

ret=""
if (logged_user == False):
ret=sj.dumps("[invalid]")
else:
ret=response.session_id
if auth.is_logged_in():
ret=session.session_id
else:
logger.debug("not logged in")
if (ret == None):
ret="DummySessionId"

return ret

user gets successfully logged in, but the session id, session_status and 
session_file_name are always set to None. sessionid_id_name is set to 
session_id_appname

user record is like this -




-- 

--- 
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/groups/opt_out.




[web2py] Re: Select table in drop down import the file and edit

2013-07-05 Thread Anthony


web2py_component("{{=URL('default', 'form.load')}}" + "/" +
  jQuery(this).val(), target='form')

The above line will result in an ajax request being sent from the browser 
when a selection is made. If you use the developer tools in the browser to 
watch the network traffic, you should be able to observe that ajax call.

As far as I can tell, your code works fine, so must be something wrong with 
your set up. Maybe show the code for the main page and its view and clarify 
exactly where the view code you have already shown resides.

Anthony

On Friday, July 5, 2013 12:58:47 AM UTC-4, Rohitraj Sharma wrote:
>
> No Anthony , i am loading as the main page. no same function. Actually i 
> am not able to understand where i have to pass URL which u have shared.
>
> Thanks Anthony 
>
> On Thursday, 4 July 2013 20:59:46 UTC+5:30, Anthony wrote:
>>
>> On Thursday, July 4, 2013 2:59:17 AM UTC-4, Rohitraj Sharma wrote:
>>
>>> http://127.0.0.1:8000/appname/default/form
>>>
>>
>> That can't be the URL requested by the browser via ajax -- it would be of 
>> the form /appname/default/form.load/table_name. Is that the URL you are 
>> loading as the main page in the browser? Is the view code you're showing 
>> the view for the form() function? You should be loading the main page via a 
>> separate function/view, and have that page make the ajax call to the form() 
>> function. When I try your code with that approach, it works fine.
>>
>> Anthony
>>
>

-- 

--- 
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/groups/opt_out.




[web2py] Re: Controller function doesn’t presents the view page

2013-07-05 Thread Anthony
What is presented instead of a web page?

On Friday, July 5, 2013 8:36:34 AM UTC-4, ric...@gmail.com wrote:
>
> Hello all,
>
> I’ve made a post before but did not receive any answers, so I will try to 
> explain my problem I little better hoping that someone knows the answer.
>
> I have a controller function the redirects to another one:
>
> def result2():
>
> print 'B'
>
> session.temparray2 = json.loads(request.body.read())
>
> print  session.temparray2
>
> redirect(URL(c='default',f='segunda.html'))
>
> return dict()
>
>  
>
> def segunda():
>
> print 'ccc'
>
> return dict()
>
>  
>
> I thought that, running result2() would present the segunda.html view to 
> the user, but instead it does not. The segunda() functions runs, because I 
> can see the printed ‘’ on python window, but no web page is presented. 
>  Any one knows why the 'default/segunda.html’ is not shown?
>
> Thank you in advance
>
> Ricardo
>
>  
>
>  
>

-- 

--- 
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/groups/opt_out.




Re: [web2py] Re: Dynamic query from string

2013-07-05 Thread Michele Comitini
Go faster:

def getValueByID(table, field, id):
return db[table][id][field]

which is a shourtcut for :
def getValueByID(table, field, id):
return db(db[table].id == id).select(limitby=(0,1),
orderby_on_limitby=False).first()[field]


2013/7/5 Remco K 

> Very nice! It's working for me like this:
>
> def getValueByID(table, field, id):
> return db(db[table].id == id).select().first()[field]
>
> Thanks Massimo!
>
> def dynamicQuery(table, field,** value):
> return db(db[table][field]id =**= value).select()
>
> Op vrijdag 5 juli 2013 12:56:16 UTC+2 schreef Remco K het volgende:
>
>> Hi all,
>>
>> I have a question:
>>
>> I want to create queries dynamically:
>>
>> def dynamicQuery(table, field, value):
>> return db([table][field] == [value]).select()
>>
>> dynamicQuery('tableName', 'fieldName', 'value')
>>
>> Is there someone who can tell me how I can achieve this?
>>
>> Thanks in advance!
>> Remco
>>
>  --
>
> ---
> 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/groups/opt_out.
>
>
>

-- 

--- 
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/groups/opt_out.




Re: [web2py] Controller function doesn’t presents the view page

2013-07-05 Thread Jason (spot) Brower
Where is your segunda.html file located?  What is the name of this file
that you have? And what is in the file? :P  Sounds like a view issue to
me.  If you don't have any data in those files it may not return anything.
BR,
Jason



On Fri, Jul 5, 2013 at 3:36 PM,  wrote:

> Hello all,
>
> I’ve made a post before but did not receive any answers, so I will try to
> explain my problem I little better hoping that someone knows the answer.**
> **
>
> I have a controller function the redirects to another one:
>
> def result2():
>
> print 'B'
>
> session.temparray2 = json.loads(request.body.read())
>
> print  session.temparray2
>
> redirect(URL(c='default',f='segunda.html'))
>
> return dict()
>
> ** **
>
> def segunda():
>
> print 'ccc'
>
> return dict()
>
> ** **
>
> I thought that, running result2() would present the segunda.html view to
> the user, but instead it does not. The segunda() functions runs, because I
> can see the printed ‘’ on python window, but no web page is presented.
>  Any one knows why the 'default/segunda.html’ is not shown?
>
> Thank you in advance
>
> Ricardo
>
> ** **
>
> ** **
>
> --
>
> ---
> 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/groups/opt_out.
>
>
>

-- 

--- 
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/groups/opt_out.




Re: [web2py] Re: Can Sql (sqlite) injections occur if normal html forms are used?

2013-07-05 Thread Vinicius Assef
Right.

SQL injections don't occur due to forms. They happen due to fragile
validation/transformation of data coming from forms into SQL
statements/arguments.

On Thu, Jul 4, 2013 at 4:44 AM, Massimo Di Pierro
 wrote:
> Forms do not affect SQL injections as long as you use the DAL to communicate
> to the database. If you use row SQL you may be vulnerable to SQL injections.
>
>
> On Thursday, 4 July 2013 00:43:23 UTC-5, qwer qwer wrote:
>>
>> I have used normal html forms instead of web2py forms at many places.Does
>> this make sql injections possible? Can someone please give an example of
>> such an injection, if possible.   thanks
>
> --
>
> ---
> 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/groups/opt_out.
>
>

-- 

--- 
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/groups/opt_out.




[web2py] Controller function doesn’t presents the view page

2013-07-05 Thread ricgama


Hello all,

I’ve made a post before but did not receive any answers, so I will try to 
explain my problem I little better hoping that someone knows the answer.

I have a controller function the redirects to another one:

def result2():

print 'B'

session.temparray2 = json.loads(request.body.read())

print  session.temparray2

redirect(URL(c='default',f='segunda.html'))

return dict()

 

def segunda():

print 'ccc'

return dict()

 

I thought that, running result2() would present the segunda.html view to 
the user, but instead it does not. The segunda() functions runs, because I 
can see the printed ‘’ on python window, but no web page is presented. 
 Any one knows why the 'default/segunda.html’ is not shown?

Thank you in advance

Ricardo

 

 

-- 

--- 
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/groups/opt_out.




[web2py] Re: Dynamic query from string

2013-07-05 Thread Remco K
Very nice! It's working for me like this:

def getValueByID(table, field, id):
return db(db[table].id == id).select().first()[field]

Thanks Massimo!

def dynamicQuery(table, field, value):
return db(db[table][field]id == value).select()

Op vrijdag 5 juli 2013 12:56:16 UTC+2 schreef Remco K het volgende:
>
> Hi all,
>
> I have a question:
>
> I want to create queries dynamically:
>
> def dynamicQuery(table, field, value):
> return db([table][field] == [value]).select()
>
> dynamicQuery('tableName', 'fieldName', 'value')
>
> Is there someone who can tell me how I can achieve this?
>
> Thanks in advance!
> Remco
>

-- 

--- 
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/groups/opt_out.




[web2py] Frontend/Backend Developer needed for my company.

2013-07-05 Thread Jason (spot) Brower
We are expanding.
Encompass Solutions does only Python based implementations of software and
have a specific focus on Startups and using Web2py to solve there software
problems.
You need to be able to do or prove you can learn the following:

* Prove your ability with a test project with us.  (We pay you when it's
done.)

* Develop front-end with heave javascript and coffee script a big plus.

* Develop Backend in python with lots of ffeatures like JSON messages and
working with media rich content, video, sound, and merging content to make
more videos.  For example with Gstreamer.

* Contribute to open source code in some way.  Cause that's awesome.

* Use Linux as their desktop. It's what we use for all out tools and your
going to be annoying if your can't use them with us.

You don't have to meet all of them, but if your up for the challenge we
have some tests you can take to prove yourself.  You will be tested with
real customers so we plan to pay you for that effort.

You will work from abroad and travelling may happen once or twice a year
for customer stuff or simple hanging with the team to have some bonding
time.

Call if you like: +358 040 687 
or Email me: encomp...@gmail.com

BR,
Jason Brower

-- 

--- 
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/groups/opt_out.




[web2py] Re: Dynamic query from string

2013-07-05 Thread Massimo Di Pierro
very close to your guess:

def dynamicQuery(table, field, value):
return db(db[table][field] == value).select()

On Friday, 5 July 2013 05:56:16 UTC-5, Remco K wrote:
>
> Hi all,
>
> I have a question:
>
> I want to create queries dynamically:
>
> def dynamicQuery(table, field, value):
> return db([table][field] == [value]).select()
>
> dynamicQuery('tableName', 'fieldName', 'value')
>
> Is there someone who can tell me how I can achieve this?
>
> Thanks in advance!
> Remco
>

-- 

--- 
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/groups/opt_out.




[web2py] Re: web2py Greek users

2013-07-05 Thread Massimo Di Pierro
When is it?

On Friday, 5 July 2013 04:42:36 UTC-5, Stelios Koroneos wrote:
>
> Are there any web2py Greek users around ?
> I was thinking of doing a web2py intro in hackerspace.gr 
> http://hackerspace.gr/wiki/Main_Page and would be a nice to arrange a 
> meetup of web2py users before/after
>
> Stelios
>

-- 

--- 
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/groups/opt_out.




[web2py] Dynamic query from string

2013-07-05 Thread Remco K
Hi all,

I have a question:

I want to create queries dynamically:

def dynamicQuery(table, field, value):
return db([table][field] == [value]).select()

dynamicQuery('tableName', 'fieldName', 'value')

Is there someone who can tell me how I can achieve this?

Thanks in advance!
Remco

-- 

--- 
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/groups/opt_out.




[web2py] web2py Greek users

2013-07-05 Thread Stelios Koroneos
Are there any web2py Greek users around ?
I was thinking of doing a web2py intro in hackerspace.gr 
http://hackerspace.gr/wiki/Main_Page and would be a nice to arrange a 
meetup of web2py users before/after

Stelios

-- 

--- 
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/groups/opt_out.




[web2py] Re: Using convert_tz with DAL

2013-07-05 Thread Stelios Koroneos


On Friday, June 28, 2013 12:46:43 PM UTC+3, Niphlod wrote:
>
> are you aware that web2py handles timezones automatically if set to do so ?
>
> If you want to leverage mysql own function, you have to write raw queries 
> for that.
>
>

Yes i've used the web2py tz conversion ability that was introduced in 
recent versions, but as our existing system was using the mysql tz_convert 
functions and timezone database i wanted to stick with that.

Thanks for your time 

-- 

--- 
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/groups/opt_out.