[web2py] demo down

2013-02-10 Thread Sebastian E. Ovide
the interactive demo from the official web sire (
http://web2py.com/demo_admin) is down: admin disabled because unable to
access password file

-- 
Sebastian E. Ovide

-- 

--- 
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: demo down

2013-02-10 Thread Sebastian E. Ovide
also: http://www.web2py.com/welcome

On 10 February 2013 12:04, Sebastian E. Ovide sebastian.ov...@gmail.comwrote:

 the interactive demo from the official web sire (
 http://web2py.com/demo_admin) is down: admin disabled because unable to
 access password file

 --
 Sebastian E. Ovide






-- 
Sebastian E. Ovide

-- 

--- 
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] Moving Data From Sqlite To MySql

2012-06-06 Thread Sebastian E. Ovide
check this http://goo.gl/VpwpB for moving the data... and the official book
has a chapter that explains how to use an existing DB.

Do you want also to keep the migration info ?

On Wed, Jun 6, 2012 at 9:18 AM, Hassan Alnatour
halna...@gardeniatelco.comwrote:

 Dear ALL,

 How can i move my database from sqlite to mysql ?

 regards,




-- 
Sebastian E. Ovide


Re: [web2py] Error connecting with mysql database

2012-06-06 Thread Sebastian E. Ovide
would try to replace *Like* with something else ? it is a MySql (SQL)
keyword...

On Wed, Jun 6, 2012 at 1:08 PM, Hassan Alnatour
halna...@gardeniatelco.comwrote:

 Field('Like','integer',default=1),




-- 
Sebastian E. Ovide


Re: [web2py] How to limit upload speed in web2py?

2012-06-06 Thread Sebastian E. Ovide
via your webserver config...

On Wed, Jun 6, 2012 at 8:14 AM, Charles Tang atao...@gmail.com wrote:

 I am using SQLForm to submit a large file and want to limit the upload
 speed. How to do it ? Thanks.




-- 
Sebastian E. Ovide


[web2py] file upload field dissapears if form is not valid

2012-05-20 Thread Sebastian E. Ovide
Hi All,

if a form has some file upload fields, and some field validation then when
the form is submitted with some field not valid (such as mandatory field
not filled up), then the form will display the usual red message (as it
should), keeping all the values of the form as entered by the user except
for the files upload. Therefore the user is *forced* to upload the files
again...

Is it working as designed ?

thanks

-- 
Sebastian E. Ovide


Re: [web2py] Re: file upload field dissapears if form is not valid

2012-05-20 Thread Sebastian E. Ovide
done http://code.google.com/p/web2py/issues/detail?id=811

On Sun, May 20, 2012 at 4:03 PM, Massimo Di Pierro 
massimo.dipie...@gmail.com wrote:

 Yes. We could change this and cache the file. Open a ticket as suggestion
 for improvement. Anyway, this needs to be thought true has it may have some
 security implications.


 On Sunday, 20 May 2012 09:22:02 UTC-5, sebastian wrote:

 Hi All,

 if a form has some file upload fields, and some field validation then
 when the form is submitted with some field not valid (such as mandatory
 field not filled up), then the form will display the usual red message (as
 it should), keeping all the values of the form as entered by the user
 except for the files upload. Therefore the user is *forced* to upload
 the files again...

 Is it working as designed ?

 thanks

 --
 Sebastian E. Ovide






[web2py] how to see line number or errors in my own module

2012-05-19 Thread Sebastian E. Ovide
Hi All,

In my controller I'm importing my own module class with

from messaging import Msg

If  my class has any error (say a typo for example), then web2py opens the
usual ticket, but it doesn't show the line where the actual error occurred.
It shows the line where the *controller imported the module* which is
not very clarifying

Is it working as expected ?

thanks


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


Traceback (most recent call last):

  File /home/sebas/dev/web2py/peerservices/gluon/restricted.py, line
205, in restricted

exec ccode in environment

  File 
/home/sebas/dev/web2py/peerservices/applications/peerservices/controllers/default.py
http://localhost:8000/admin/default/edit/peerservices/controllers/default.py,
line 376, in module

  File /home/sebas/dev/web2py/peerservices/gluon/globals.py, line
173, in lambda

self._caller = lambda f: f()

  File 
/home/sebas/dev/web2py/peerservices/applications/peerservices/controllers/default.py
http://localhost:8000/admin/default/edit/peerservices/controllers/default.py,
line 289, in send_suggestion

from messaging import Msg

  File /home/sebas/dev/web2py/peerservices/gluon/custom_import.py,
line 289, in __call__

globals, locals, fromlist, level)

  File /home/sebas/dev/web2py/peerservices/gluon/custom_import.py,
line 132, in __call__

raise e  # Don't hide something that went wrong
AttributeError: 'dict' object has no attribute 'auth'



289. from messaging import Msg

-- 
Sebastian E. Ovide


[web2py] is globalenv official ?

2012-05-19 Thread Sebastian E. Ovide
Hi all,

I've seen *globalenv* in  current which is I find very useful..

as It is not documented in the official book (at least the search cannot
find it), just wondering if it is part of the official web2py and therefore
it will be there for ever..

thanks

-- 
Sebastian E. Ovide


Re: [web2py] How to get the selected menu / active menu ?

2012-05-19 Thread Sebastian E. Ovide
could tuning the CSS (see web2py-menu-active) help ?


On Sat, May 19, 2012 at 1:22 PM, François Delpierre 
francois.delpie...@gmail.com wrote:

 Hi,

 Here is my solution :
 If my response.menu is somthing like :

  response.menu = [('Menu1', False), ('Menu2', True), ('Menu3', False)]

 I can use this in my view to display the active menu :
 {{=[x[0] for x in response.menu if x[1]==True][0]}}


 It's working well, but is there no better and more efficient way ?

 Thanks,




-- 
Sebastian E. Ovide


Re: [web2py] Re: error deleting a row if the file uploaded is missing?

2012-05-19 Thread Sebastian E. Ovide
done. http://code.google.com/p/web2py/issues/detail?id=809

On Mon, May 14, 2012 at 2:50 AM, Massimo Di Pierro 
massimo.dipie...@gmail.com wrote:

 Please open a ticket with the traceback. This needs to be fixed quick.


 On Sunday, 13 May 2012 03:27:54 UTC-5, sebastian wrote:

 Hi All,

 I have a table with Field('image1', type='upload', uploadseparate=True,
 autodelete=True), If the file uploaded is missing (because deleted by hand
 for example) then I would get this error trying to delete a row

  db(db.service.id==1).delete()
 Traceback (most recent call last):
   File console, line 1, in module
   File /home/sebas/dev/web2py/**peerservices/gluon/dal.py, line 7582,
 in delete
 self.delete_uploaded_files()
   File /home/sebas/dev/web2py/**peerservices/gluon/dal.py, line 7643,
 in delete_uploaded_files
 %s.%s % (items[0], items[1]),
 IndexError: list index out of range

 Is it working as intended ?

 thanks

 --
 Sebastian E. Ovide







-- 
Sebastian E. Ovide


Re: [web2py] Re: how to see line number or errors in my own module

2012-05-19 Thread Sebastian E. Ovide
oo... by known bug you mean that there is a ticket for it ?

On Sat, May 19, 2012 at 5:43 PM, Niphlod niph...@gmail.com wrote:

 it's a known issue with the custom importer

 you could after all debug in the old way inserting print statements here
 and there in your module to see where execution stops.

 Il giorno sabato 19 maggio 2012 12:00:45 UTC+2, sebastian ha scritto:

 Hi All,

 In my controller I'm importing my own module class with

 from messaging import Msg

 If  my class has any error (say a typo for example), then web2py opens
 the usual ticket, but it doesn't show the line where the actual error
 occurred. It shows the line where the *controller imported the module*
 which is not very clarifying

 Is it working as expected ?

 thanks


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


 Traceback (most recent call last):



   File /home/sebas/dev/web2py/**peerservices/gluon/restricted.**py, line 
 205, in restricted



 exec ccode in environment



   File 
 /home/sebas/dev/web2py/**peerservices/applications/**peerservices/controllers/**default.py
  
 http://localhost:8000/admin/default/edit/peerservices/controllers/default.py,
  line 376, in module



   File /home/sebas/dev/web2py/**peerservices/gluon/globals.py**, line 173, 
 in lambda



 self._caller = lambda f: f()



   File 
 /home/sebas/dev/web2py/**peerservices/applications/**peerservices/controllers/**default.py
  
 http://localhost:8000/admin/default/edit/peerservices/controllers/default.py,
  line 289, in send_suggestion



 from messaging import Msg



   File /home/sebas/dev/web2py/**peerservices/gluon/custom_**import.py, 
 line 289, in __call__



 globals, locals, fromlist, level)



   File /home/sebas/dev/web2py/**peerservices/gluon/custom_**import.py, 
 line 132, in __call__



 raise e  # Don't hide something that went wrong


 AttributeError: 'dict' object has no attribute 'auth'



 289. from messaging import Msg

 --
 Sebastian E. Ovide







-- 
Sebastian E. Ovide


Re: [web2py] Re: What to expect in web2py 2.0

2012-05-19 Thread Sebastian E. Ovide
will it break back compatibility with web2py 1.x ?

On Sat, May 19, 2012 at 11:33 PM, Pystar aitoehi...@gmail.com wrote:

 fingers crossed.


 On Saturday, May 19, 2012 10:49:30 PM UTC+1, Massimo Di Pierro wrote:

 We do not have one. I think we should be done by the end of june, perhaps
 sooner.

 On Saturday, 19 May 2012 15:26:49 UTC-5, Pystar wrote:

 +1 for the mongodb support, I am playing with the version in trunk and I
 really prefer the use of bootstrap css. So when is the release date?

 On Saturday, May 19, 2012 9:10:13 PM UTC+1, Massimo Di Pierro wrote:

 Basically the same features we have in trunk now. Just lots of bug
 fixes compared to latest table.
 We will also have full versining, geo api in db, possibly better
 support for mongodb and sybase, and a new welcome app based on bootstrap
 (and this is holding up more than anything else).

 massimo

 On Saturday, 19 May 2012 14:34:07 UTC-5, Pystar wrote:

  I am really curious at what features to expect in web2py version 2.0
 and when it would be released? Anyone? Massimo?




-- 
Sebastian E. Ovide


Re: [web2py] Re: URL vars doesn't like Storage

2012-05-17 Thread Sebastian E. Ovide
As I pass it as vars via LOAD:

{{=LOAD('default',
'send_suggestion',
vars={ 'c':request.controller,
'f':request.function,
'args':request.args,
'vars':request.vars},
ajax_trap=True)}}

does it mean that request.vars  has not been serialized/deserialized
correctly ?


On Thu, May 17, 2012 at 2:14 AM, Massimo Di Pierro 
massimo.dipie...@gmail.com wrote:

 _vars = request.vars['vars'] or {}
 subject = 'FEEDBACK: %s' % URL(c=_c,f=_f,args=_args,vars=**_vars) #
  vars doesn't like Storage

 _vars is a string. You are trying to pass a string where it expects a
 dict()

 On Wednesday, 16 May 2012 18:01:13 UTC-5, sebastian wrote:

 Hi All,

 I'd like to add a feedback form in layout.html so that the users can
 click on it on whatever page they are and send a message to the site admin.
 To be useful, the form must include the current page and vars so that the
 admin can click on a link and go to exactly the same place where the user
 wrote the feedback from.

 in layout I've added

 {{=LOAD('default',
 'send_suggestion',
 vars={ 'c':request.controller,
 'f':request.function,
 'args':request.args,
 'vars':request.vars},
 ajax_trap=True)}}

 in default.py

 def send_suggestion():
 form = SQLFORM.factory(
Field('message', 'text', requires=IS_NOT_EMPTY())
)

 if form.process().accepted:
 _c = request.vars['c']
 _f = request.vars['f']
 _args = request.vars['args'] or []
 _vars = request.vars['vars'] or {}
 subject = 'FEEDBACK: %s' % URL(c=_c,f=_f,args=_args) **#
  it works
 subject = 'FEEDBACK: %s' % URL(c=_c,f=_f,args=_args,vars=**_vars) 
 #
  vars doesn't like Storage
 response.flash = 'Thanks for your feedback'
 # will send email


 return form


 The problem is that URL *vars* doesn't like storage...


 Traceback (most recent call last):



   File /home/sebas/dev/web2py/**peerservices/gluon/restricted.**py, line 
 205, in restricted



 exec ccode in environment



   File 
 /home/sebas/dev/web2py/**peerservices/applications/**peerservices/controllers/**default.py
  
 http://localhost:8000/admin/default/edit/peerservices/controllers/default.py,
  line 370, in module



   File /home/sebas/dev/web2py/**peerservices/gluon/globals.py**, line 173, 
 in lambda



 self._caller = lambda f: f()



   File 
 /home/sebas/dev/web2py/**peerservices/applications/**peerservices/controllers/**default.py
  
 http://localhost:8000/admin/default/edit/peerservices/controllers/default.py,
  line 301, in send_suggestion



 subject = 'FEEDBACK: %s' % URL(c=_c,f=_f,args=_args,vars=**_vars)



   File /home/sebas/dev/web2py/**peerservices/gluon/html.py, line 290, in 
 URL



 if vars.has_key('_signature'): vars.pop('_signature')


 AttributeError: 'str' object has no attribute 'has_key'



 Any better way than converting the Storage into dict ?

 thanks
 --
 Sebastian E. Ovide







-- 
Sebastian E. Ovide


Re: [web2py] Re: URL vars doesn't like Storage

2012-05-17 Thread Sebastian E. Ovide
thanks for that Anthony  I thought that in some automagicaly way web2py
was seriallizing/deserializing... ;)

by the way as the request.vars.vars contains Storage {'': '',
'www': '4'} ast.literal_eval(request.vars.vars[9:-1]) did the trick

Just wondering if there is an easier way of doing it (I mean: to pass
the current URL+vars to the LOAD)


On Thu, May 17, 2012 at 1:03 PM, Anthony abasta...@gmail.com wrote:

 As I pass it as vars via LOAD:

 {{=LOAD('default',
 'send_suggestion',
 vars={ 'c':request.controller,
 'f':request.function,
 'args':request.args,
 'vars':request.vars},
 ajax_trap=True)}}

 does it mean that request.vars  has not been serialized/deserialized
 correctly ?


 When you pass a dict as a URL var, the dict is converted to a string
 representation of the dict and then urlencoded. When it is decoded, you
 have a string representation of the dict (equivalent to repr(request.vars)
 in this case), not the dict itself (actually, I think it's a list with the
 string representation of the dict as its sole element). To get the dict
 back, you can safely eval it using ast.literal_eval:

 import ast
 _vars = ast.literal_eval(request.vars.vars[0]) if request.vars.vars else
 {}

 Anthony




-- 
Sebastian E. Ovide


Re: [web2py] Re: URL vars doesn't like Storage

2012-05-17 Thread Sebastian E. Ovide
I like that !

On Thu, May 17, 2012 at 9:10 PM, Anthony abasta...@gmail.com wrote:

 Even better, just put the URL in a hidden field in the form:

 {{=LOAD('default', 'send_suggestion', ajax_trap=True)}}

 def send_suggestion():
 form = SQLFORM.factory(Field('message', 'text', requires=IS_NOT_EMPTY
 ()),
 hidden=dict(url=XML(URL(args=request.args, vars=request.get_vars
 
 if form.process().accepted:
 subject = 'FEEDBACK: %s' % request.vars.url
 response.flash = 'Thanks for your feedback'

 Anthony


 On Thursday, May 17, 2012 4:00:02 PM UTC-4, Anthony wrote:

 by the way as the request.vars.vars contains Storage {'': '',
 'www': '4'} ast.literal_eval(reques**t.vars.vars[9:-1]) did the trick


 Sorry, I was thinking dict instead of Storage.


 Just wondering if there is an easier way of doing it (I mean: to
 pass the current URL+vars to the LOAD)


 How about:

 {{=LOAD('default', 'send_suggestion',
 vars=dict(url=URL(args=request**.args, vars=request.get_vars)),
 ajax_trap=True)}}

 def send_suggestion():
 import urllib
 form = SQLFORM.factory(Field('**message', 'text', requires=
 IS_NOT_EMPTY()))
 if form.process().accepted:
 subject = 'FEEDBACK: %s' % urllib.unquote(request.get_**vars.url)
 response.flash = 'Thanks for your feedback'


 Anthony





-- 
Sebastian E. Ovide


[web2py] URL vars doesn't like Storage

2012-05-16 Thread Sebastian E. Ovide
Hi All,

I'd like to add a feedback form in layout.html so that the users can click
on it on whatever page they are and send a message to the site admin. To be
useful, the form must include the current page and vars so that the admin
can click on a link and go to exactly the same place where the user wrote
the feedback from.

in layout I've added

{{=LOAD('default',
'send_suggestion',
vars={ 'c':request.controller,
'f':request.function,
'args':request.args,
'vars':request.vars},
ajax_trap=True)}}

in default.py

def send_suggestion():
form = SQLFORM.factory(
   Field('message', 'text', requires=IS_NOT_EMPTY())
   )

if form.process().accepted:
_c = request.vars['c']
_f = request.vars['f']
_args = request.vars['args'] or []
_vars = request.vars['vars'] or {}
subject = 'FEEDBACK: %s' % URL(c=_c,f=_f,args=_args) #  it
works
subject = 'FEEDBACK: %s' %
URL(c=_c,f=_f,args=_args,vars=_vars) #  vars doesn't like Storage
response.flash = 'Thanks for your feedback'
# will send email


return form


The problem is that URL *vars* doesn't like storage...


Traceback (most recent call last):

  File /home/sebas/dev/web2py/peerservices/gluon/restricted.py, line
205, in restricted

exec ccode in environment

  File 
/home/sebas/dev/web2py/peerservices/applications/peerservices/controllers/default.py
http://localhost:8000/admin/default/edit/peerservices/controllers/default.py,
line 370, in module

  File /home/sebas/dev/web2py/peerservices/gluon/globals.py, line
173, in lambda

self._caller = lambda f: f()

  File 
/home/sebas/dev/web2py/peerservices/applications/peerservices/controllers/default.py
http://localhost:8000/admin/default/edit/peerservices/controllers/default.py,
line 301, in send_suggestion

subject = 'FEEDBACK: %s' % URL(c=_c,f=_f,args=_args,vars=_vars)

  File /home/sebas/dev/web2py/peerservices/gluon/html.py, line 290, in URL

if vars.has_key('_signature'): vars.pop('_signature')
AttributeError: 'str' object has no attribute 'has_key'



Any better way than converting the Storage into dict ?

thanks
-- 
Sebastian E. Ovide


[web2py] error deleting a row if the file uploaded is missing?

2012-05-13 Thread Sebastian E. Ovide
Hi All,

I have a table with Field('image1', type='upload', uploadseparate=True,
autodelete=True), If the file uploaded is missing (because deleted by hand
for example) then I would get this error trying to delete a row

 db(db.service.id==1).delete()
Traceback (most recent call last):
  File console, line 1, in module
  File /home/sebas/dev/web2py/peerservices/gluon/dal.py, line 7582, in
delete
self.delete_uploaded_files()
  File /home/sebas/dev/web2py/peerservices/gluon/dal.py, line 7643, in
delete_uploaded_files
%s.%s % (items[0], items[1]),
IndexError: list index out of range

Is it working as intended ?

thanks

-- 
Sebastian E. Ovide


Re: [web2py] Common controller functionality

2012-05-13 Thread Sebastian E. Ovide
what about using modules ? you can create as many classes as you want and
then just use them.

On Sun, May 13, 2012 at 5:31 PM, Yarin ykess...@gmail.com wrote:

 I've always liked the idea of controllers as classes, allowing for
 subclassing of controllers, and thereby providing an easy means of handling
 common controller functionality. I'm curious as to why web2py didn't follow
 this approach? Is there a recommended way of handling code that is common
 to a group of controllers (besides sticking it at the top of a controller
 file)?




-- 
Sebastian E. Ovide


Re: [web2py] Re: Common controller functionality

2012-05-13 Thread Sebastian E. Ovide
in Java (say for example Java EE 6), you would have your own Classes
hierarchy (as extended as needed), and then you would inject what you need
in your controllers (backing beans)...  in web2py you can do exactly the
same. Create your own hierarchy of classes (as extended as needed) and then
just import the modules that you need in your controllers

On Sun, May 13, 2012 at 7:07 PM, Yarin ykess...@gmail.com wrote:

 That's what I've already been doing, but making decisions in the model on
 which code to run based on the request controller turns into a hot mess of
 distributed logic and violates the most basic principles of MVC (Models
 knowing about Controllers?)


 On Sunday, May 13, 2012 1:58:25 PM UTC-4, simon wrote:

 You can put common controller functionality in the model. This is
 executed on each request before the controllers. You can check which
 controller is called in request.controller.

 On Sunday, 13 May 2012 17:31:22 UTC+1, Yarin wrote:

 I've always liked the idea of controllers as classes, allowing for
 subclassing of controllers, and thereby providing an easy means of handling
 common controller functionality. I'm curious as to why web2py didn't follow
 this approach? Is there a recommended way of handling code that is common
 to a group of controllers (besides sticking it at the top of a controller
 file)?




-- 
Sebastian E. Ovide


Re: [web2py] Re: Common controller functionality

2012-05-13 Thread Sebastian E. Ovide
Yarin, I see... I know what you mean... I had a quick glance into
compileapp.py line 555... (I guess that it the right place to look at)...
and it looks like that inheritance is not part of it...

filename = os.path.join(folder, 'controllers/%s.py'
  % controller)


nevertheless, about *modules*, why do you think that the controller logic
doesn't fit in modules ? Modules are just that: modules you can place
there anything you want without breaking any layer of your design.

I have not done any BIG job with web2py, so we should ask to people whom
have done something big to be fair... but I would put under controllers
only just that: controllers... as small as possible leaving all the the
complex logic in the modules same for the models just those models
that you need ALL the time and leave other model in modules (in the
right path of course)...

well... I'm not saying that this is the best way... just my personal taste
;)



On Sun, May 13, 2012 at 8:00 PM, Yarin ykess...@gmail.com wrote:

 Sebastian- I already have class hierarchies for my model/module stuff.
 What I'm talking about using classes to handle controller logic- assembling
 views, controlling access, processing forms, managing redirection, etc -
 that stuff belongs in controllers, not modules. But the flat, one
 function-per-controller design means the power of classes can't easily be
 applied to that stuff. Sure, I could write a controller class hierarchy and
 pull it into each function, but that seems like a lot of grunt work for
 what frameworks like  kohana and web.py have out of the box with controller
 classes.

 PBreit- I'm doing this too, but again, lacks the organization of classes.

 I'm not saying the web2py way is wrong- I'm sure Massimo has a reason for
 setting things up this way, as almost everything I've seen is incredibly
 well thought out- but I just don't see the upside of this approach, and as
 my project has grown large I've found myself wishing I had controllers I
 could subclass..

 On Sunday, May 13, 2012 2:18:21 PM UTC-4, sebastian wrote:

 in Java (say for example Java EE 6), you would have your own Classes
 hierarchy (as extended as needed), and then you would inject what you need
 in your controllers (backing beans)...  in web2py you can do exactly the
 same. Create your own hierarchy of classes (as extended as needed) and then
 just import the modules that you need in your controllers

 On Sun, May 13, 2012 at 7:07 PM, Yarin  wrote:

 That's what I've already been doing, but making decisions in the model on
 which code to run based on the request controller turns into a hot mess of
 distributed logic and violates the most basic principles of MVC (Models
 knowing about Controllers?)


 On Sunday, May 13, 2012 1:58:25 PM UTC-4, simon wrote:

 You can put common controller functionality in the model. This is
 executed on each request before the controllers. You can check which
 controller is called in request.controller.

 On Sunday, 13 May 2012 17:31:22 UTC+1, Yarin wrote:

 I've always liked the idea of controllers as classes, allowing for
 subclassing of controllers, and thereby providing an easy means of 
 handling
 common controller functionality. I'm curious as to why web2py didn't 
 follow
 this approach? Is there a recommended way of handling code that is common
 to a group of controllers (besides sticking it at the top of a controller
 file)?




 --
 Sebastian E. Ovide







-- 
Sebastian E. Ovide


[web2py] wysiwyg editor saving ALL in a blob (including pictures)

2012-05-13 Thread Sebastian E. Ovide
Hi All,

I've read a couple of tutorials (probably from web2py slices) about HTML
wysiwyg + images uploading (in separate table)

I was just wondering... what if instead of defining a TEXT field and an
additional table for storing images we define a BLOB field and we store
ALL there HTML + Images (or images names. and images in FS)

I don't know if there is any lib around that would do it if not, I
guess that using the CKEditor + some web2py logic (probably serializing a
dictionary with the text + images) should not be so difficult to create a
widget for it...

what do you think ?

thanks

-- 
Sebastian E. Ovide


Re: [web2py] Re: storing more than 1 millions uploaded files

2012-05-12 Thread Sebastian E. Ovide
just wondering... (I know that it is not a normal application)... where
would you store a couple of millions pictures of less than 60K each ?


On Sat, May 12, 2012 at 2:04 AM, Massimo Di Pierro 
massimo.dipie...@gmail.com wrote:

 Oops. Sorry. I read it in a hurry.

 I would not use the file system for something like this. Anyway, upload
 separate creates up to 1296 subfolder per table.field. This number can be
 increased.


 On Friday, 11 May 2012 18:33:22 UTC-5, Anthony wrote:

 On Friday, May 11, 2012 7:25:21 PM UTC-4, Massimo Di Pierro wrote:

 yes.

 Field('name','upload',**uploadseparate=True)


 He's aware of that but seems to think that one level of sub-folders won't
 be enough (he's expecting millions of files, so still more than 1000 files
 per sub-folder, even with uploadseparate=True).

 I don't think web2py includes any out-of-the-box solution for generating
 deeper levels of sub-folders for uploaded files. Maybe subclass Field for
 that upload field and roll your own .store() and .retrieve() methods.

 Anthony




-- 
Sebastian E. Ovide


Re: [web2py] To uuid or not?

2012-05-12 Thread Sebastian E. Ovide
I find that using the ID works perfectly well...  I'm using UUID only on
those situations where I need to pass it as vars/args (URLS for example) so
that hackers cannot guess the IDs

 what problems have you got moving the DB to another computer ?

On Fri, May 11, 2012 at 2:07 PM, Johann Spies johann.sp...@gmail.comwrote:

 I developed my original app to use uuid-crossreferences in stead of the
 normal 'id'-field.  The reason was that I wanted it to be consistent when I
 move the database to another computer.

 Now I am rewriting the app to make it more efficient and to make the code
 cleaner - applying some new features that came into web2py recently - e.g.
 archiving.

 I am considering it to drop the dependence on uuid-references and move
 back to id-based references and to keep the present references in the
 database valid I am thinking (as an experiment) to do it in the following
 way:

 * add a computed field to each table that use uuid-based references.  This
 computation will then lookup the id in the other table based on the
 uuid-reference.
 * after confirming that the references work well, I plan to drop the
 uuid-fields and uuid-based reference fields from each table using them. and
 change the computed field to normal reference-field.
 * remove archiving methods based on uuid which I have developed and use
 the new archiving in the trunk.

 Am I overlooking something?

 I would like the opinion of some experts in this list on what I have in
 mind please.  Is there still a place for uuid-based references?  When?

 Regards
 Johann
 --
 Because experiencing your loyal love is better than life itself,
 my lips will praise you.  (Psalm 63:3)




-- 
Sebastian E. Ovide


[web2py] deleting row with files

2012-05-12 Thread Sebastian E. Ovide
Hi All,

I have a table with a Field('image1', type='upload', uploadseparate=True),

The upload works well nevertheless when I delete the a record, the
image is left in the server (of course it doesn't happen if I store the
file in the DB)

Is it working as expected ? any way to automatize the file deletion ?

thanks

-- 
Sebastian E. Ovide


Re: [web2py] deleting row with files

2012-05-12 Thread Sebastian E. Ovide
nice... it works (I suspect that the subfolder that was self generated
is not deleted as it will be created anyway at some point...)



On Sat, May 12, 2012 at 8:30 PM, Bruno Rocha rochacbr...@gmail.com wrote:

 autodelete=True



 On Sat, May 12, 2012 at 4:15 PM, Sebastian E. Ovide 
 sebastian.ov...@gmail.com wrote:

 Hi All,

 I have a table with a Field('image1', type='upload', uploadseparate=True),

 The upload works well nevertheless when I delete the a record, the
 image is left in the server (of course it doesn't happen if I store the
 file in the DB)

 Is it working as expected ? any way to automatize the file deletion ?

 thanks

 --
 Sebastian E. Ovide







 --

 Bruno Rocha
 [http://rochacbruno.com.br]




-- 
Sebastian E. Ovide


[web2py] storing more than 1 millions uploaded files

2012-05-11 Thread Sebastian E. Ovide
Hi All,

I need to sore a lot of file... up to few millions.
Just wondering if that can be done with web2py out of the box without the
need of adding extra code for storing them in a sub folders tree
structure  I've read that web2py can organize the files uploaded in
folders. I've created a simple file upload app and it looks like it creates
only one level of subfolder. Something like uploads/tablename/fieldname/xx/
where xx seams been the first two characters of the file uuid. As the
filesystem starts to get slow with more than 1k files per folder, that
means that after 1k x 1k = 1M files the system will get slow...

Am I correct ? is it possible to configure web2py to use more than one
level (per table/field) ?

thanks ?

-- 
Sebastian E. Ovide


Re: [web2py] Re: form in layout.html?

2012-05-09 Thread Sebastian E. Ovide
the ajax_trap=True fixed the form which nows call search_bar... but redirect
(URL('services', vars={'qry':form.vars.qry}))  is rendered inside the
component

What I'm trying to do, is to include a simple form in the layout.html that
calls a function (as it is now, with the ajax_trap trick), and if it is not
empty, it will redirect to a different page (loading the whole page)

On Wed, May 9, 2012 at 11:06 PM, Anthony abasta...@gmail.com wrote:

 As it is, your component is not an Ajax component, and it is also not set
 up to trap form submissions via Ajax. So, when you submit the form, it will
 be submitted to the function of the parent page, not to the search_bar
 function. If you want the component to be loaded via Ajax, then set
 ajax=True (and the form will automatically be submitted via Ajax to the
 search_bar function). If you don't want an Ajax component but want the form
 submitted to the search_bar function, then set ajax_trap=True -- that
 will trap the form submission and submit it via Ajax to search_bar. Another
 option would be to explicitly set the form's action attribute to submit
 to the search_bar action, but in that case the entire page will reload with
 the response from search_bar, which presumably is not what you want.

 Anthony


 On Wednesday, May 9, 2012 5:45:08 PM UTC-4, sebastian wrote:

 in default.py I have

 def search_bar():
 form = FORM('Search  ',INPUT(_name='qry'))
 if form.process().accepted:
 response.flash=''
 if form.vars.qry:
 redirect(URL('services', vars={'qry':form.vars.qry}))
 return form

 and in layout.html

 {{=LOAD('default','search_bar'**)}}

 but for some reason the form is never accepted...

 anh ideas ?

 thanks

 On Monday, 21 June 2010 17:44:50 UTC+1, mdipierro wrote:

 You can also do

 if response.flash: response.headers['web2py-**component-
 flash']=response.flash

 before return and you can keep using response.flash and session.flash
 as usual.

 On Jun 21, 10:10 am, Iceberg iceb...@21cn.com wrote:
  Wow, thanks very much for sharing this trick. I knew it could be easy
  and elegant! :-)
 
  On Jun20, 10:15pm, mdipierro mdipie...@cs.depaul.edu wrote:
 
   Because the form is submitted and returned via ajax the usual
   mechanism does not work but you can do:
 
   def form():
   form=SQLFORM.factory(
  Field('name', requires=IS_NOT_EMPTY()))
   if form.accepts(request.vars, session):
   response.headers['web2py-**component-flash'] = 'form
 accepted'
   else:
   response.headers['web2py-**component-flash'] = 'form has
 errors'
   return form
 
   I.E. place the flash in a HTTP header and web2py will read it and
   place it in the flash box.
 
   On Jun 19, 11:23 am, Julius Minka j...@minka.sk wrote:
 
def form():
form=SQLFORM.factory(
   Field('name', requires=IS_NOT_EMPTY()))
if form.accepts(request.vars, session):
response.flash = 'form accepted'
else:
response.flash = 'form has errors'
return form
 
Flash is not displayed in this place, elsewhere is working. Why?
Or, how let user know about the result of form submission?
 
V Sobota, 19. jún 2010 o 00:41 -0700, mdipierro napísal(a):
 
 Just do
 
 def contact():
  form=SQLFORM.factory()
  if form.accepts()
  return form # not dict(form=form)
 
 and in layout.html
 
 {{=LOAD('default','contact')}}
 
 On Jun 18, 11:26 am, Julius Minka j...@minka.sk wrote:
  I need a contact form (name, address,...) on every page of a
 web site.
  Thinking about putting the form into layout.html and use some
 Ajax to
  send entered values to be processed by a controller. I would
 like to
  avoid page reload on form submission.
 
  I found 2 possible solutions in the archive:
  1.http://groups.google.com/**group/web2py/browse_thread/**
 thread/f162f35e4a.http://groups.google.com/group/web2py/browse_thread/thread/f162f35e4a...

  Is this incomplete? How process function is called?
 
  2.http://groups.google.com/**group/web2py/browse_thread/**
 thread/82fad17e26.http://groups.google.com/group/web2py/browse_thread/thread/82fad17e26...

  I ran application mentioned in the thread. This is probably
 close, but
  complicated.
 
  What is good and simple approach to this issue? I do not have
 much
  experience with Ajax.
 
  Thanks
  Julius




Re: [web2py] Eclipse and autocomplete

2012-05-02 Thread Sebastian E. Ovide
any luck with that ?

On Mon, Apr 16, 2012 at 12:33 PM, szimszon szims...@gmail.com wrote:

 Okay. The

 if 0:
 from gluon import *

 request, session, response, T, cache = current.request, current.
 session, current.response, current.t, current.
 cache
 from gluon.dal import DAL
 from gluon.tools import Auth, Service, Crud

 db = DAL()
 auth = Auth()
 service = Service()
 crud = Crud()

 code is messing with the autocomplete but if I remove it than I have lots
 of error markers in the code if debugging is enabled :(


 2012. április 16., hétfő 0:02:03 UTC+2 időpontban cyan a következőt írta:


 I've just tried it out.

 Unzip the latest stable source code of web2py to a folder, say,
 web2py_src.
 Go to Eclipse - Preferences - PyDev - 'Interpreter - Python'
 In the 'System PYTHONPATH' window, add 'web2py_src' to the path.

 So far, it seems autocomplete is working without doing all the import
 statements... Hope it helps.

 On Monday, April 9, 2012 3:04:30 PM UTC-4, ikdme wrote:

 Tang, please how do i implement this your suggestion?

 On Thu, Apr 5, 2012 at 3:54 PM, Xiaofeng Tang fengcli...@gmail.comwrote:

 I use PyDev and add web2py src into PyDev - PythonPath to resolve the
 incorrect refs and enable autocompletion.

 Alternatively, u could install the path of web2py src into systeml
 envirnoment vairable pythonpath.

 --- on 2012/4/5 22:51:41, Rod Watkins rwatk...@live.ca wrote:
  I know this has been asked before. I don't mean to be an annoyance.
  I've done the searches are read numerous posts about how to handle
  this. But the advice conflicts and I've yet to actually fix the
 problem.
 
  What is the best way to handle imports for eclipse to get autocomplete
  to work properly (as well as rid eclipse of all the incorrect error
  messages?
 
  I rather like having autocomplete functioning since, as a beginner, it
  helps me discover functionality that I might otherwise miss (besides
  saving some typing).
 
  Please accept my thanks in advance for any help on this.
 
  Cordially,
  Rod Watkins





-- 
Sebastian E. Ovide


Re: [web2py] Re: Eclipse highlighting errors in my web2py app

2012-05-02 Thread Sebastian E. Ovide
same here...

On Sun, Mar 4, 2012 at 2:10 AM, Marcelo Zamperetti marcel...@gmail.comwrote:

 Thanks.
 I updated and using this code disappeared with the errors on 'FORM'
 and 'INPUT'. 'db', 'request', 'session', 'response' still with error.

 On Mar 3, 8:20 pm, Anthony abasta...@gmail.com wrote:
  Which version of web2py are you using? If the latest (1.99.6), you should
  be able to do:
 
  if 0:
  from gluon import *
 
  That imports the entire API, including dummy request, response, session,
  cache, and T objects. Does that remove the errors?
 
  Anthony
 
 
 
 
 
 
 
  On Saturday, March 3, 2012 4:42:43 PM UTC-5, Marcelo Zamperetti wrote:
 
   I'm trying to use Eclipse + Pydev to develop a web2py application.
   On my controller, Eclipse highlights as errors all the stuff that I'm
   using from web2py, like 'request', 'session', 'db', 'FORM', 'INPUT'
   and so on.
   I did a good deal of searching, but didn't find any real solution.
   What seems to be the most common solution is doing like
   if 0:
   session = None
   [...]
 
   I tried importing those 'missing' classes explicitly, but wasn't able
   to do that for all the errors, and if I remember right, the imports
   themselves were marked as errors (like I will describe below).
 
   Another similar problem: when I import my own modules, which are on
   the 'modules' directory, it also highlights the import as an error:
   'Unresolved import: xxx', it works, I can call the functions from my
   module, but it is highlighted as an error.
 
   I liked web2py most of all frameworks, but I simply can't work with
   all those 'errors'. First because they are *very* annoying, and
   because there are so many of them, I will often overlook an error that
   is really an error, and also spend more time looking for it, and that
   is counter-productive.
 
   Thanks a lot for any information.




-- 
Sebastian E. Ovide


Re: [web2py] Re: sqlite int field that behave as string ?

2012-05-01 Thread Sebastian E. Ovide
I don't know how sqllite works... but using sqlbrowser (found it in the
standard ubuntu repo) I could see that the field was String so I could
change it to Number... (and match what declared in web2py)

if sqlbrowser can do that, I guess that also web2py could do that too
It is not a big deal tough...

On Mon, Apr 30, 2012 at 3:48 PM, Anthony abasta...@gmail.com wrote:

 note: probably (I don't remember) it was String at some point...


 That could be the problem if it's SQLite -- see
 http://web2py.com/books/default/chapter/29/6#Fixing-broken-migrations.

 Anthony




-- 
Sebastian E. Ovide


[web2py] sqlite int field that behave as string ?

2012-04-29 Thread Sebastian E. Ovide
Hi All,

I have a field defined as integer but for some reason it is string


In [34]: db.agreement.client_stars.type
Out[34]: 'integer'

In [35]: db(db.agreement.client_stars 10
).select(db.agreement.client_stars).first()
Out[35]: Row {'client_stars': 5}

In [36]: db._lastsql
Out[36]: 'SELECT  agreement.client_stars FROM agreement WHERE
(agreement.client_stars  10);'


note: probably (I don't remember) it was String at some point...

any ideas ?

-- 
Sebastian E. Ovide


Re: [web2py] Re: Ubuntu and Python3

2012-04-26 Thread Sebastian E. Ovide
just wondering if having web3py in python 3 will give us some problem with
some share hosting

On Thu, Apr 26, 2012 at 2:52 PM, Johann Spies johann.sp...@gmail.comwrote:

 That article says that Python 2.7 will still be part of Ubuntu so there
 should not be a problem.

 Regards
 Johann


 --
 Because experiencing your loyal love is better than life itself,
 my lips will praise you.  (Psalm 63:3)




-- 
Sebastian E. Ovide


[web2py] welcome application calls lockerz.com ?

2012-04-25 Thread Sebastian E. Ovide
Hi All,

I've just noticed that web2py welcome application is doing calls like this

http://pts.lockerz.com/1x1.gif?ver=0.1app=a2auuid=e91edf70-1558-4a46-8ef1-5081e621377devent=loadurl=http%3A%2F%2Flocalhost%3A8000%2Fwelcome%2Fdefault%2Findexreferrer=

any ideas ?

thanks

-- 
Sebastian E. Ovide


[web2py] python question: how to reuse this code

2012-04-22 Thread Sebastian E. Ovide
Hi All,

I'm using this function at least twice... and I'll use it again... how can
I reuse it in some way ? for example passing the table and arg as function
parameters...

def provider():
theProvider = None
if len((request.args))=1:
providers=db(db.auth_user.uuid==request.args[0]).select()
if len(providers) == 1:
theProvider = providers[0]

return dict(theProvider=theProvider)

thanks
-- 
Sebastian E. Ovide


Re: [web2py] Re: Continuous Integration

2012-04-22 Thread Sebastian E. Ovide
I am interested too...

Is there any reason why not to use the same tools that other python
projects are using ?

On Sat, Apr 21, 2012 at 5:58 PM, lpg lucas.gei...@gmail.com wrote:

 HI All I'm doing some research on Continuous Integration for web2py, and
 would really like someone to share their experience with this. Seems like
 it would be an important complement to web2py enterprise deployments.


 On Monday, January 18, 2010 12:39:48 PM UTC-2, Matthew wrote:

 Has anyone gotten web2py working with continuous integration tools
 like Hudson, Buildbot, or TeamCity?

 I found a post talking about BuildBot,
 http://groups.google.com/**group/web2py/browse_thread/**
 thread/5fefb19ed2ef8d2d/**f9cf313ae3fc9164?lnk=gstq=**
 buildbot#f9cf313ae3fc9164http://groups.google.com/group/web2py/browse_thread/thread/5fefb19ed2ef8d2d/f9cf313ae3fc9164?lnk=gstq=buildbot#f9cf313ae3fc9164
 ,
 but it is largely theoretical.




-- 
Sebastian E. Ovide


Re: [web2py] Re: python question: how to reuse this code

2012-04-22 Thread Sebastian E. Ovide
Thanks Anthony... nice shortcut...

and, any way to pass also the column as parameter ? (I don't need it right
now... just wondering)

On Sun, Apr 22, 2012 at 3:50 PM, Anthony abasta...@gmail.com wrote:

 How general does it need to be? Are you always checking a field named
 uuid (but potentially in different tables)? Does the id being checked
 always come from request.args(0)?

 Note, request.args(0) simply returns None if there are no request.args, so
 as long as no records have a uuid == None, you don't have to bother
 checking for request.args -- just use request.args(0), and you won't get
 any records when there are no request.args. Also, if you add .first() after
 .select(), you'll get the first row of the returned set, or None if no
 records where returned -- so again, you don't have to test for the length
 of the returned set.

 Maybe something like:

 def provider(table, id=request.args(0)):
 return dict(provider=db(db[table].uuid == id).select().first())

 myprovider = provider('auth_user')

 In that case, if there are no request.args, as long as no records have
 uuid==None, the function will return None. Likewise, if there is a
 request.args(0) but its value is not one of the uuid's in the table (i.e.,
 no records are returned), the function will return None.

 Anthony


 On Sunday, April 22, 2012 8:33:13 AM UTC-4, sebastian wrote:


 Hi All,

 I'm using this function at least twice... and I'll use it again... how
 can I reuse it in some way ? for example passing the table and arg as
 function parameters...

 def provider():
 theProvider = None
 if len((request.args))=1:
 providers=db(db.auth_user.**uuid==request.args[0]).select(**)
 if len(providers) == 1:
 theProvider = providers[0]

 return dict(theProvider=theProvider)

 thanks
 --
 Sebastian E. Ovide







-- 
Sebastian E. Ovide


Re: [web2py] Re: extra column with random number to make record not guessable

2012-04-19 Thread Sebastian E. Ovide
I didn't know that it was possible...  isn't  the ID created by web2py ?

On Sun, Apr 15, 2012 at 12:28 AM, howesc how...@umich.edu wrote:

 nothing stops you from making the UUID the ID field in the database.  most
 databases support such behavior.

 GAE even provides a way to name a record though i don't think we have
 built that in to web2py yet.but GAE's default ID generation is across
 the entire database so i have never been able to guess the next ID of a
 table.


 On Saturday, April 14, 2012 2:40:25 PM UTC-7, Anthony wrote:

 Well, it's probably best to use access control on the server rather than
 relying on someone not guessing an ID, but if you really need to enable
 access solely via the URL, then you probably want a long ID (like a UUID).

 Anthony

 On Saturday, April 14, 2012 5:16:53 PM UTC-4, pbreit wrote:

 How do people usually do this? Obviously it's easiest just to use IDs
 and prety easy to avoid any problems with guessing IDs.

 But if you do want to obfuscate IDs I suppose you could either add the
 column (not ideal since better to work with IDs) or do the encryption each
 time you create and retrieve an ID (for example, via virtual fields).

 Here's an article with several implementations:
 http://kevin.vanzonneveld.net/**techblog/article/create_short_**
 ids_with_php_like_youtube_or_**tinyurl/http://kevin.vanzonneveld.net/techblog/article/create_short_ids_with_php_like_youtube_or_tinyurl/





-- 
Sebastian E. Ovide


[web2py] extra column with random number to make record not guessable

2012-04-14 Thread Sebastian E. Ovide
Hi All,

as I'm using some links with id=blablabla where the ID is the real ID as
generated by web2py, that make very easy to guess other records (see the
movie Social Networks how they got the pictures of students just changing
the ID from the URL)...

just wondering if web2py  has already some magic that add an extra column
with an unique random number

thanks

-- 
Sebastian E. Ovide


Re: [web2py] Re: extra column with random number to make record not guessable

2012-04-14 Thread Sebastian E. Ovide
nice !, thanks

On Sat, Apr 14, 2012 at 9:41 PM, Anthony abasta...@gmail.com wrote:

 Maybe something like:

 from gluon.utils import web2py_uuid

 db.define_table('mytable', Field('myid', default=web2py_uuid), ...)

 That will create a unique 36-character uuid for each record inserted.

 Anthony


 On Saturday, April 14, 2012 4:12:45 PM UTC-4, sebastian wrote:

 Hi All,

 as I'm using some links with id=blablabla where the ID is the real ID as
 generated by web2py, that make very easy to guess other records (see the
 movie Social Networks how they got the pictures of students just changing
 the ID from the URL)...

 just wondering if web2py  has already some magic that add an extra column
 with an unique random number

 thanks

 --
 Sebastian E. Ovide







-- 
Sebastian E. Ovide


[web2py] why web2py is not listed in Google App Engine ? (Django is there!)

2012-02-15 Thread Sebastian E. Ovide
Hi List,

As we all know, web2py runs very nicely in GAE. So why do they mention
Django and not web2py in
http://code.google.com/appengine/docs/python/python27/newin27.html ???


-- 
Sebastian E. Ovide


Re: [web2py] Re: keep shared objects permanently in RAM: Is it possible ?

2012-02-12 Thread Sebastian E. Ovide
thanks Michele

On Fri, Feb 10, 2012 at 10:57 PM, Michele Comitini 
michele.comit...@gmail.com wrote:

 I wrote:
  The problem with MAP_ANONYMOUS is that you cannot share after fork.

 I should have written: you cannot share *a mmap created* after fork.

 
  http://www.kernel.org/doc/man-pages/online/pages/man2/mmap.2.html
 
  If you are on Linux here you find some quick explanation how mmap,
  tmpfs and shm fs relate to each others:
  http://stackoverflow.com/questions/904581/shmem-vs-tmpfs-vs-mmap




-- 
Sebastian E. Ovide


Re: [web2py] Re: keep shared objects permanently in RAM: Is it possible ?

2012-02-09 Thread Sebastian E. Ovide
Thanks for that Michele !
That is a nice trick for sharing information with different processes
reducing to the minimum the FS IO... It still has the IO bottleneck of
read/write from/to file compare with real data permanent in memory... but
still a valid approach...

On Thu, Feb 9, 2012 at 12:58 AM, Michele Comitini 
michele.comit...@gmail.com wrote:

  You can reach a very high level of
 parallelism with lower dead-locking probability than with java
 threads.


any source about that ? (any paper, benchmarks etc...)


-- 
Sebastian E. Ovide


Re: [web2py] Re: keep shared objects permanently in RAM: Is it possible ?

2012-02-08 Thread Sebastian E. Ovide
it looks good just wondering if that would work with fastcgi ? say that
we have 10 fastcgi running... are they sharing the modules ?




On Tue, Feb 7, 2012 at 10:53 PM, Ross Peoples ross.peop...@gmail.comwrote:

 Sorry Mariano, I misspelled your name in my last post :)

 To give you a better example of what you might want to do here is a more
 advanced module that makes a static class and better resembles the
 singleton pattern:

 class Counter(object):
 instance = None

 @classmethod
 def get(cls):
 if cls.instance == None:
 cls.instance = Counter()

 return cls.instance

 def __init__(self, message='Hello World!'):
 self.message = message
 self.count = 0

 def get_count(self):
 self.count += 1
 return self.count

 def get_message(self):
 return self.message


 Then your controller would look something like this now:

 from mymodule import Counter
 counter = Counter.get()
 count = counter.get_count()

 return dict(count=count)

 By calling Counter.get() instead of Counter(), we ensure that there is
 only ever once instance of the Counter object, and that the object will
 last for the lifetime of the web2py instance.




-- 
Sebastian E. Ovide


Re: [web2py] Re: keep shared objects permanently in RAM: Is it possible ?

2012-02-07 Thread Sebastian E. Ovide
Hi Mariano,

what do you mean by permanently importing the data in a module ?

As far as I know, every request will reload ALL the models and module
again... and again... and again

in the mean time I'm reading about mmap as suggested by Michele... even is
it looks like (I have not studied it yet) it still uses the FS... What I'm
trying to do is to save the LOADING model + modules time of every
request... (not sure if WSGI has some limitations here...)

thanks

On Tue, Feb 7, 2012 at 11:03 AM, Mariano Reingart reing...@gmail.comwrote:

 You can use a multi-threaded webserver,  permanently importing the data in
 a module.




-- 
Sebastian E. Ovide


Re: [web2py] web2py long term projects: experiences ?

2012-02-07 Thread Sebastian E. Ovide
Thanks for that Martin, appreciated.

I've read your slides: They are very clear !


On Tue, Feb 7, 2012 at 11:35 AM, Martín Mulone mulone.mar...@gmail.comwrote:

 I can tell my experience, I'm working for 2 years with web2py or more I
 think. I work in different projects, one I currently developing I think is
 quite big, work with millons of records, and is very complex and has many
 lines of code and many tables, is an internal application for a national
 company.


how many full time dev are working in this team ?

thanks again


Sebastian E. Ovide


Re: [web2py] Re: keep shared objects permanently in RAM: Is it possible ?

2012-02-06 Thread Sebastian E. Ovide
I'm talking about ~16G... Just investigating if it makes sense (if it is
possible) to reimplement a Java EE application in Python...

I guess that I should re post this question in WSGI group

On Mon, Feb 6, 2012 at 9:41 AM, Niphlod niph...@gmail.com wrote:

 cache.ram() with an high expire time, or redis with the contrib module
 will make that possible.

 Obviously the BIG chunk of information needs to be serialized
 (Written to cache) and deserialized (Read from Cache), so don't go too
 far in too big (5mb) .



 On Feb 6, 1:06 am, Bruno Rocha rochacbr...@gmail.com wrote:
  Redis or MongoDB seems to be what you are looking for!
 
  On Sun, Feb 5, 2012 at 9:58 PM, Sebastian E. Ovide 
 
 
 
 
 
 
 
 
 
  sebastian.ov...@gmail.com wrote:
   Hi All,
 
   Is it possible to keep a BIG chunk of information in memory RAM
   permanently (without reloading it for each new session/request) so that
   different sessions (from X different users using the system at the same
   time) can access (R/W) it concurrently ? For the kind of processing
 that
   need to be done on the data, ALL of it must be in memory at the same
 time,
   and due for the size of it, it is not practical to load/save it for
 each
   request. (to slow)
 
   thanks
 
   --
   Sebastian E. Ovide
 
  --
 
  Bruno Rocha
  [http://rochacbruno.com.br]




-- 
Sebastian E. Ovide


Re: [web2py] Re: keep shared objects permanently in RAM: Is it possible ?

2012-02-06 Thread Sebastian E. Ovide
nop, I said SHARED among sessions...

so say that we have few hundreds of users connected at the same time, each
of them has it own small session, and all of them can access a shared 16G
(which is managed by a class that knows how to manage it... so some methods
are thread safe and some methods are not ... )

not sure if that is possible with WSGI.

On Mon, Feb 6, 2012 at 11:28 AM, Niphlod niph...@gmail.com wrote:

 let me be clear... you want to share in some place 16 gigabytes of
 data that someone can access in a single chunk to work with (i.e.
 every client needs to have 16 gb all in memory for itself)?

 let's say you have 4 different users, you ideally have:
 - 16gb for the storage, whatever system you choose to put that on
 will occupy at least 16gb
 - 16gb*4 = 64gb of allocated memory to work with

 this gives us 80gb, and you want that in memory  NASA server
 rack ?

 Or you have 16gb of data, and each client accesses a small part of
 that (still pretty big hardware, but a lot more achievable)?




-- 
Sebastian E. Ovide


Re: [web2py] Re: keep shared objects permanently in RAM: Is it possible ?

2012-02-06 Thread Sebastian E. Ovide
16G is nothing 2day... think about a raster image of UK !  even if it was
something smaller, imagine the time saved if you could keep some objects
always in memory saving serialization and data loading times

I don't need nothing really fancy, just something similar to Java Servlets
(they keep in memory the objects for the whole servlet life)...

googling little bit, I've found this old python framework that implements
something like that: http://www.webwareforpython.org/

anybody knows it ?

On Mon, Feb 6, 2012 at 12:59 PM, Ross Peoples ross.peop...@gmail.comwrote:

 I can't imagine that every request would need to access all 16G every
 time. I use a method for caching data between requests using modules. I
 don't know if it would be truly shared between requests, or like Niphlod
 said, would be duplicated for each request. I have had a lot of success
 using modules + singleton pattern to hold small data in memory, but never
 used it with anything large. So maybe you should play with this idea and
 see how it responds.




-- 
Sebastian E. Ovide


Re: [web2py] Re: keep shared objects permanently in RAM: Is it possible ?

2012-02-06 Thread Sebastian E. Ovide
On Mon, Feb 6, 2012 at 7:39 PM, Bruno Rocha rochacbr...@gmail.com wrote:

 16 GB shared across requests is called Database, to run a memory like
 database you should go with Redis!


:D it sounds a lot... but it is not anymore... specially if you want to
serve a lot of requests in realtime !

we are using two machines with 36G for a real commercial application. We
use so much memory for implementing a tree for fast research of addresses
using phonetics (28M addresses)... using Oracle (a big machine optimized by
 two DBA experts) was two slow for us (around 1 second per query)...  A big
improvement was obtained using special indexes (created by lucene) stored
in SSD... but still to slow for us... so the only solution was to use a
special tree all in memory

just investigating if there is something else in the open source that could
save us Weblogic licences

-- 
Sebastian E. Ovide


[web2py] keep shared objects permanently in RAM: Is it possible ?

2012-02-05 Thread Sebastian E. Ovide
Hi All,

Is it possible to keep a BIG chunk of information in memory RAM permanently
(without reloading it for each new session/request) so that different
sessions (from X different users using the system at the same time) can
access (R/W) it concurrently ? For the kind of processing that need to be
done on the data, ALL of it must be in memory at the same time, and due for
the size of it, it is not practical to load/save it for each request. (to
slow)

thanks

-- 
Sebastian E. Ovide


Re: [web2py] Any bored developers want to help?

2012-02-03 Thread Sebastian E. Ovide
nice !

On Thu, Feb 2, 2012 at 1:15 PM, Bruce Wade bruce.w...@gmail.com wrote:

 No, used cakephp for ethicaldeal, and used pyramid for youadworld, however
 for the last month I have been porting youadworld.com to web2py and the
 new version is much much much better then the current live one. I will
 update the development version of the site later today and provide a link
 to see the new youadworld.com (not complete yet, but getting close)


 On Thu, Feb 2, 2012 at 1:19 AM, Sebastian E. Ovide 
 sebastian.ov...@gmail.com wrote:

 did you use web2py for ethicaldeal.com and youadworld.com  ?


 On Thu, Feb 2, 2012 at 3:32 AM, Bruce Wade bruce.w...@gmail.com wrote:

 Hi,

 I am currently using web2py to build a fitness portal, that allows
 members to:

1. track their food consumption
2. calculate the calories/fat/protein etc..,
3. build and track their workout programs
4. track fitness progress IE: Weight changes, muscle gained etc...
5. trainers can track their clients, find new clients
6. companies can track their trainers, find new trainers, and track
their clients or find new clients.


 Currently their are 2 designers and 2 developers on the team (including
 myself).

 This is a challenging project and I am willing to payout a good % to any
 developers who become core developers of the application.

 A little about me:
 I have developed the very successful ethicaldeal.com group-on clone
 website. (Making over $800 a day in revenue)
 Developed the so far very successful youadworld.com advertising
 website. (Very successful means, it launched November 18th, 2011 and has
 already generated over $5 million in revenue)

 Unfortunately I am not the owner of either of these two projects, so I
 don't get to benefit all that much from their success even though I spent
 lots of sleepless nights on the development :(. However I have learned a
 lot from working on these and other projects and want to now make one I own
 that is very successful.

 Anyway enough of the rant if anyone is interested in potentially wasting
 a lot of their time to help build something that will benefit a lot of
 people let me know.

 --
 --
 Regards,
 Bruce Wade
 http://ca.linkedin.com/in/brucelwade
 http://www.wadecybertech.com
 http://www.warplydesigned.com
 http://www.fitnessfriendsfinder.com




 --
 Sebastian E. Ovide






 --
 --
 Regards,
 Bruce Wade
 http://ca.linkedin.com/in/brucelwade
 http://www.wadecybertech.com
 http://www.warplydesigned.com
 http://www.fitnessfriendsfinder.com




-- 
Sebastian E. Ovide


[web2py] web2py long term projects: experiences ?

2012-02-03 Thread Sebastian E. Ovide
Hi All,

just wondering... do you know any blog/page with some long term (at least 2
years) web2py projects experiences ?

It could be interesting to see how those projects have done so far in terms
of testing (unit/integration), scaling, upgrades (web2py upgrade),
refactoring etc

thanks

-- 
Sebastian E. Ovide


Re: [web2py] Any bored developers want to help?

2012-02-02 Thread Sebastian E. Ovide
did you use web2py for ethicaldeal.com and youadworld.com  ?

On Thu, Feb 2, 2012 at 3:32 AM, Bruce Wade bruce.w...@gmail.com wrote:

 Hi,

 I am currently using web2py to build a fitness portal, that allows members
 to:

1. track their food consumption
2. calculate the calories/fat/protein etc..,
3. build and track their workout programs
4. track fitness progress IE: Weight changes, muscle gained etc...
5. trainers can track their clients, find new clients
6. companies can track their trainers, find new trainers, and track
their clients or find new clients.


 Currently their are 2 designers and 2 developers on the team (including
 myself).

 This is a challenging project and I am willing to payout a good % to any
 developers who become core developers of the application.

 A little about me:
 I have developed the very successful ethicaldeal.com group-on clone
 website. (Making over $800 a day in revenue)
 Developed the so far very successful youadworld.com advertising website.
 (Very successful means, it launched November 18th, 2011 and has already
 generated over $5 million in revenue)

 Unfortunately I am not the owner of either of these two projects, so I
 don't get to benefit all that much from their success even though I spent
 lots of sleepless nights on the development :(. However I have learned a
 lot from working on these and other projects and want to now make one I own
 that is very successful.

 Anyway enough of the rant if anyone is interested in potentially wasting a
 lot of their time to help build something that will benefit a lot of people
 let me know.

 --
 --
 Regards,
 Bruce Wade
 http://ca.linkedin.com/in/brucelwade
 http://www.wadecybertech.com
 http://www.warplydesigned.com
 http://www.fitnessfriendsfinder.com




-- 
Sebastian E. Ovide


Re: [web2py] cluster: distributed locks

2012-01-27 Thread Sebastian E. Ovide
yes... very similar... I guess that just deleting the JS part and creating
a new DB object within the plugin  (so that it has it own ttransaction)
will make the work...

thanks

On Thu, Jan 26, 2012 at 9:20 AM, Bruno Rocha rochacbr...@gmail.com wrote:

 I dont know if it is related, but there is a Locking plugin

 http://web2py.com/plugins/default/locking


 On Thu, Jan 26, 2012 at 7:05 AM, Sebastian E. Ovide 
 sebastianov...@gmail.com wrote:

 ok, I guess that the answer is no... (or I didn't formulate the question
 correctly)


 On Thu, Jan 19, 2012 at 11:51 PM, sebastian sebastianov...@gmail.comwrote:

 Hi All,

 just thinking on how to implement a distributed locking system in web2py
 using a DB: one row per each lock, lock_name is unique, if the row doesn't
 exist, then it is locked, if the row exist already, then it cannot be lock
 as it is already locked !

 I'd like to create a module like this (that can be called from anywhere
 in web2py)

 def lock(lock name):
begin transaction
does the row exist ?
  no = insert new row
commit transaction
return result

 def unlock(lock_name):
begin transaction
delete row where name = lock_name
commit transaction


 BUT not sure if this is possible (of course it is !) in web2py...

 consider this controller

 def hello1():
do a  lot of things
db.commit()
do more things in the DB

### here is my doubt: ###
if lock(some resource): ###  I'm calling a method that opens and
 close a transaction inside a transaction !!!
   do something
   unlock(some resource)
else
  do something else

 another example 3
if lock(resource A):
  if lock(resource B):
 do a lot of things woth both resources
 unlock(resource B)
 unlock(resource A)
  else
so other things
unlock(resource A)

do more things

db.commit()
do more staff


  any better idea ?

 thansk




 --
 Sebastian E. Ovide






 --

 Bruno Rocha
 [http://rochacbruno.com.br]




-- 
Sebastian E. Ovide


Re: [web2py] Re: begin a transaction manually ?

2012-01-27 Thread Sebastian E. Ovide
I guess that defining two will work for me... thanks !

On Thu, Jan 26, 2012 at 2:40 PM, Bruno Rocha rochacbr...@gmail.com wrote:

 maybe if there's a way to .close() the db to be able to define it again.

 http://zerp.ly/rochacbruno
 Em 26/01/2012 12:18, Massimo Di Pierro massimo.dipie...@gmail.com
 escreveu:

  You cannot clone it. but can make two.

 On Jan 26, 3:10 am, Sebastian E. Ovide sebastian.ov...@gmail.com
 wrote:
   2) yes but not concurrently, unless you have two db objects.
 
  Is it possible to clone a db object ? instead of declare 2 (or n) db
  objects in the model, can I create a new one a controller based on db
  declared in the model ?
 
  --
  Sebastian E. Ovide




-- 
Sebastian E. Ovide


Re: [web2py] cluster: distributed locks

2012-01-26 Thread Sebastian E. Ovide
ok, I guess that the answer is no... (or I didn't formulate the question
correctly)

On Thu, Jan 19, 2012 at 11:51 PM, sebastian sebastianov...@gmail.comwrote:

 Hi All,

 just thinking on how to implement a distributed locking system in web2py
 using a DB: one row per each lock, lock_name is unique, if the row doesn't
 exist, then it is locked, if the row exist already, then it cannot be lock
 as it is already locked !

 I'd like to create a module like this (that can be called from anywhere in
 web2py)

 def lock(lock name):
begin transaction
does the row exist ?
  no = insert new row
commit transaction
return result

 def unlock(lock_name):
begin transaction
delete row where name = lock_name
commit transaction


 BUT not sure if this is possible (of course it is !) in web2py...

 consider this controller

 def hello1():
do a  lot of things
db.commit()
do more things in the DB

### here is my doubt: ###
if lock(some resource): ###  I'm calling a method that opens and
 close a transaction inside a transaction !!!
   do something
   unlock(some resource)
else
  do something else

 another example 3
if lock(resource A):
  if lock(resource B):
 do a lot of things woth both resources
 unlock(resource B)
 unlock(resource A)
  else
so other things
unlock(resource A)

do more things

db.commit()
do more staff


 any better idea ?

 thansk




-- 
Sebastian E. Ovide


Re: [web2py] Re: begin a transaction manually ?

2012-01-26 Thread Sebastian E. Ovide
 2) yes but not concurrently, unless you have two db objects.


Is it possible to clone a db object ? instead of declare 2 (or n) db
objects in the model, can I create a new one a controller based on db
declared in the model ?

-- 
Sebastian E. Ovide


Re: [web2py] NInja IDE 2.0b and Plugin contest

2011-10-26 Thread Sebastian E. Ovide
how is it compared with Eclipse PyDev ?

On Wed, Oct 26, 2011 at 2:35 PM, Martín Mulone mulone.mar...@gmail.comwrote:

 I'm using too and is great.


 2011/10/26 Bruno Rocha rochacbr...@gmail.com

 NInja IDE released 2.0b and it is awesome! (http://www.ninja-ide.org/)

 They are running a plugin contest http://www.ninja-ide.org/plugins/

 Any taker to create a web2py plugin?

 What features do people think a web2py plugin for Ninja-IDE should have?

 --

 Bruno Rocha
 [http://rochacbruno.com.br]




 --
  http://martin.tecnodoc.com.ar




-- 
Sebastian E. Ovide


Re: [web2py] Web2py on android

2011-10-20 Thread Sebastian E. Ovide
I've just read about it
http://gearsblog.blogspot.com/2011/03/stopping-gears.html   it makes
sense

It looks like HTML5 is the way to go...

On Thu, Oct 20, 2011 at 3:14 PM, Richard Vézina ml.richard.vez...@gmail.com
 wrote:

 Gears is 
 deprecatedhttp://gearsblog.blogspot.com/2011/03/stopping-gears.html and
 will no longer be available as of December 2011.

 Seems Google has drop it...

 Richard

 On Wed, Oct 19, 2011 at 1:10 PM, Sebastian E. Ovide 
 sebastian.ov...@gmail.com wrote:

 have you considered Google Gears ?


 2011/10/19 António Ramos ramstei...@gmail.com

 hello, can i install web2py on android?

 The need is to create an app for an android table that in some
 circumstances may not have network access.

 As soo as it gets network signal a replication action could syncronize
 content with a server.Example at the end of the day.

 Also the tablet may be used by everyone besides the admin.


 Am i in the wrong lane?




 --
 Sebastian E. Ovide








-- 
Sebastian E. Ovide


Re: [web2py] Web2py on android

2011-10-19 Thread Sebastian E. Ovide
have you considered Google Gears ?

2011/10/19 António Ramos ramstei...@gmail.com

 hello, can i install web2py on android?

 The need is to create an app for an android table that in some
 circumstances may not have network access.

 As soo as it gets network signal a replication action could syncronize
 content with a server.Example at the end of the day.

 Also the tablet may be used by everyone besides the admin.


 Am i in the wrong lane?




-- 
Sebastian E. Ovide


Re: [web2py] IMPORTANT

2011-10-13 Thread Sebastian E. Ovide
I've seen code of conduct implemented in different companies (surely in
all the big US companies that I've worked/collaborated for) and in some
pubilc forums too  and I find them very useful. code of conduct keep
people focus on what is important in that specific environment leaving other
things for other environments...

On Wed, Oct 12, 2011 at 2:59 PM, Massimo Di Pierro 
massimo.dipie...@gmail.com wrote:

 Do we need a policy about this?
 Do we want see other people political/religious/philosophical
 statements in there emails?




-- 
Sebastian E. Ovide


Re: [web2py] criticism of web2py

2011-10-04 Thread Sebastian E. Ovide
 | Hlapicina (Croatia) | GPG: 52B5C810





-- 
Sebastian E. Ovide


Re: [web2py] spinejs with Web2py

2011-09-30 Thread Sebastian E. Ovide
Hi Carl,

I've never used spine.js, but for what I read in
http://maccman.github.com/spine/ it is a JS framework. Therefore I cannot
imagine any reason why it would not work with web2py. With web2py you have
json/xml responses by defaul for free !!! (just use the right url)... so I
would imagine that it should be very trivial to use

good luck !

On Thu, Sep 29, 2011 at 5:32 PM, Carl m...@carlroach.com wrote:

 Is anyone using spinejs with web2py and has ajax calls working?




-- 
Sebastian E. Ovide


Re: [web2py] what about web2py 2.0?

2011-09-20 Thread Sebastian E. Ovide
+1 for breaking compatibility (in a major version) a remove obsolete
features,,,

On Tue, Sep 20, 2011 at 9:26 AM, Mengu whalb...@gmail.com wrote:

 anything special coming up?

 will it broke backward compatibility? nobody needs backward
 compatibility in a major version.

 are there any plans for a clean up?




-- 
Sebastian E. Ovide


Re: [web2py] Re: how to use cgi in web2py

2011-09-08 Thread Sebastian E. Ovide
believe me... web2py in a sharehost using CGI it is very SLOW ! (tested in
iPage)...

On Thu, Sep 8, 2011 at 12:30 PM, Web2Py Freak halna...@gardeniatelco.comwrote:

 there is nothing about using CGI  just :

 web2py provides a file cgihandler.py to interface to CGI.




-- 
Sebastian E. Ovide


Re: [web2py] R: Re: web2py hosting

2011-08-28 Thread Sebastian E. Ovide
more hosting here :
https://code.djangoproject.com/wiki/DjangoFriendlyWebHosts

it is a Django page... but if a hosting supports Django it supports also
web2py... (right?)

On Wed, Aug 24, 2011 at 10:04 PM, Valter Foresto
valter.fore...@gmail.comwrote:

 Video How to deploy / use web2py on free FluxFlex 
 hostinghttp://vimeo.com/28112026
 on Vimeo by Massimo Di Pierro. http://vimeo.com/28112026




-- 
Sebastian E. Ovide


Re: [web2py] linux help

2011-08-26 Thread Sebastian E. Ovide
what about something like this ?

#!/bin/bash
if test /path/to/VERSION -nt /path/to/VERSION.track
then
 # touch VERSION.track
 # restart apache
else
 nothing
fi


and run it in cron once every 5 minutes or so 

On Fri, Aug 26, 2011 at 5:43 PM, Massimo Di Pierro 
massimo.dipie...@gmail.com wrote:

 How would you write a cron job that automatically restarts apache when
 the file web2py/VERSION is touched/modified and works on both ubuntu
 and fedora?


Re: [web2py] Re: GAE questions...

2011-08-21 Thread Sebastian E. Ovide
thanks cfh,

that's great... web2py now supports GAE native lists !!!

any idea if it is possible to use Expanto and PolyModel classes  ?

On Sat, Aug 20, 2011 at 7:07 PM, howesc how...@umich.edu wrote:

 i use list fields (which now implemented using the GAE native list property
 and string list property) liberally.

 in places where i wish i had a join, i tend to use the web2py syntax that
 does the subquery for me:
   item.user.name
 where item is a Row, with a field user that is a reference to the user
 table, and name is a field on the user.  keep in mind that this does the
 query, just under the covers.

 cfh




-- 
Sebastian E. Ovide


[web2py] GAE questions...

2011-08-19 Thread Sebastian E. Ovide
Hi All,

I'm starting a new project in GAE and I'm considering web2py for it. I
haven't used GAE for a long time (and consequently web2py+GAE).. but the
last time that I've used it provided some extra functionalities to
compensate the nosql limitations. For example it provided some kind of in
field list (that could be used for example for replacing joins in some
situations...) or/and some kind of dynamic properties... (I think that with
a single query it was possible to retrieve all the dynamic properties)

Does the latest web2py support this extra GAE Datastore features without
using workarounds ? (by workaround I mean running extra queries for
mimicking any of those features..)

thanks

-- 
Sebastian E. Ovide


Re: [web2py] The web2py grid/crud plugin you've always dreamed about!

2011-07-23 Thread Sebastian E. Ovide
very nice work Bruno !

On Fri, Jul 22, 2011 at 11:35 PM, Bruno Rocha rochacbr...@gmail.com wrote:

 Hi,

 I present you PowerGrid Plugin (now in beta 0.1) [
 http://labs.blouweb.com/PowerGrid/]

 What is it?

 A plugin to show, manage and paginate data
 It works with paginated JSON callbacks, you can use web2py DAL's Query or
 Table, or you can create your own callback returning the desired JSON or
 JSONP

 What is has in special?
 - Based on Jquery templates
 - Server side pagination loads records on demand
 - Ajax Caching option
 - Programable in pure Python  web2py
 - You can pass JS callbacks to the event handlers
 - Can show images with Virtual Fields
 - has button system
 - totally integrated with CRUD
 - Easy to integrate with Auth
 - Can be used to manage a site content (a CMS admin page)
 - can be used to create any kind of paginated data view

 Changelog:
 - Some issues solved
 - Tested in Windows, Linux, I.E, Opera, Chrome, FF
 - Better default layout

 Beta:
 - Needs tests with different datasources
 - Need to be tested on GAE
 - Need to test multiple on the same page
 - Need to test wotking with another UI libs

 EXAMPLES:
 images - http://labs.blouweb.com/PowerGrid/default/withimages
 dataGRid - http://labs.blouweb.com/PowerGrid/default/onlydata
 Buttons - http://labs.blouweb.com/PowerGrid/default/buttons
 Scrolling - http://labs.blouweb.com/PowerGrid/default/scroll
 Customization: http://labs.blouweb.com/PowerGrid/default/nocontrol /
 http://labs.blouweb.com/PowerGrid/default/noadd /
 http://labs.blouweb.com/PowerGrid/default/nosearch
 Default search system:
 http://labs.blouweb.com/PowerGrid/default/defaultsearch?what=Ferrariwhere=manufacturer
 SubGrids: http://labs.blouweb.com/PowerGrid/default/gridinpopup
 JavaScript callbacks:
 http://labs.blouweb.com/PowerGrid/default/jscallbacks
 Custom templates: http://labs.blouweb.com/PowerGrid/default/blog (a blog
 created with it)


 DOCUMENTATION:
 Is being writen in home page
 http://labs.blouweb.com/PowerGrid/default/index (in the grid)
 source example app is well commented with options.

 IT USES:
 http://labs.blouweb.com/PowerGrid/default/about


 Comments:
 http://labs.blouweb.com/PowerGrid/default/support


 Get it:
 http://labs.blouweb.com/PowerGrid/default/get


 !!! BETA VERSION, SOME THINGS CAN CRASH, THE SERVER IS A BIT SLOW, IT WILL
 BE VERY MORE QUICKLY IN A GOOD SERVER OR GAE !!!

 Thanks if you can test and report on BitBucker or omments page.


 Bruno Rocha
 [ About me: http://zerp.ly/rochacbruno ]
 [ Aprenda a programar: http://CursoDePython.com.br ]
 [ O seu aliado nos cuidados com os animais: http://AnimalSystem.com.br ]
 [ Consultoria em desenvolvimento web: http://www.blouweb.com ]




-- 
Sebastian E. Ovide


[web2py] loading image in A(cid=request.cid) within a component

2011-07-21 Thread Sebastian E. Ovide
Hi All,

(probably this is kind of Off Topic)

In a page with a lot of components which have a lot of slow
A(cid=request.cid) links, how do you display a loading  every time that a
link is clicked (within each link) ?  (I'm talking about A links with
cid=request.cid, not about LOAD)

thanks

-- 
Sebastian E. Ovide


Re: [web2py] Re: loading image in A(cid=request.cid) within a component

2011-07-21 Thread Sebastian E. Ovide
that would be great Anthony...!

 are you tracking this new enhancement via google issue list ?

On Thu, Jul 21, 2011 at 3:03 PM, Anthony abasta...@gmail.com wrote:

 For now, I think you'd have to handle that on your own via
 Javascript/jQuery on the client side. I'll probably submit a patch soon to
 allow this option directly from the A() helper.

 Anthony

 On Thursday, July 21, 2011 4:21:44 AM UTC-4, sebastian wrote:

 Hi All,

 (probably this is kind of Off Topic)

 In a page with a lot of components which have a lot of slow
 A(cid=request.cid) links, how do you display a loading  every time that a
 link is clicked (within each link) ?  (I'm talking about A links with
 cid=request.cid, not about LOAD)

 thanks

 --
 Sebastian E. Ovide





-- 
Sebastian E. Ovide


Re: [web2py] Re: bug in crud with load and ajax=false

2011-07-20 Thread Sebastian E. Ovide
Hi Anthony,

I have not tested the trunk yet, but I have change those two lines

other_request.vars = Storage(vars)
other_request.get_vars = Storage(vars)

I still get an error:
 invalid view (default/crud_in_comp.load)(in index.html)
{{=LOAD('default','crud_in_comp.load',ajax_trap=True)}}

(in default.py)
def crud_in_comp():
return dict(crud=crud.create(db.auth_user,message=None))

any other file involved in that fix ?

On Tue, Jul 19, 2011 at 9:39 PM, Anthony abasta...@gmail.com wrote:

 Nightly build is not the same as trunk -- I'm not sure when it was last
 updated. You can pull trunk from the Google Code repository via Mercurial
 (you need to have Mercurial installed):
 http://code.google.com/p/web2py/source/checkout. Or you can just change
 the two relevant lines in your own copy of compileapp.py:
 http://code.google.com/p/web2py/source/browse/gluon/compileapp.py#126(change 
 lines 124-125 in 1.97.1 to what's in lines 126-127 in trunk) -- it
 just uses Storage(vars) in place of vars.

 Anthony

 On Tuesday, July 19, 2011 4:28:45 PM UTC-4, apple wrote:

 I downloaded the nightly build source and copied it on top of my
 web2py directory. Still get the request.vars as dict. Is that
 expected?

 On Jul 19, 5:40 pm, Anthony abas...@gmail.com wrote:
  Oops, forgot we already fixed that in trunk, so it will be work properly
 in
  the next release.
 
  Anthony
 
 
 
 
 
 
 
  On Tuesday, July 19, 2011 9:50:37 AM UTC-4, Anthony wrote:
   Good catch. I'll submit a patch.
 
   On Tuesday, July 19, 2011 8:56:08 AM UTC-4, apple wrote:
 
   I note that when ajax=False then request.vars is a dict rather than a

   storage object.
 
   On Jul 19, 11:44 am, apple sim...@gmail.com wrote:
The following works fine with the SQLFORM line and ajax=false or
ajax=true. However replacing SQLFORM line with the CRUD line it
 works
with ajax=true but fails with ajax=false, generating one of those
annoying restricted errors. I am guessing related to previous
 issue
with request.vars and load?
 
CONTROLLER
def test():
return dict()
def testload():
form=crud.update(db.customer,**1)
#form=SQLFORM(db.customer,1)
return dict(form=XML(form.xml()))
TEST.HTML VIEW
{{extend 'layout.html'}}
{{=LOAD(c='crm',f='testload.**load', ajax=False, ajax_trap=True)}}

TESTLOAD.LOAD VIEW
{{=form}}




-- 
Sebastian E. Ovide


Re: [web2py] Re: bug in crud with load and ajax=false

2011-07-20 Thread Sebastian E. Ovide
adding a default default/crud_in_comp.load made the trick.

On Wed, Jul 20, 2011 at 2:12 PM, Anthony abasta...@gmail.com wrote:

 Do you have a /views/default/crud_in_comp.load view? If not, for now you'll
 need one, as generic views aren't working in non-ajax components at the
 moment (this should be fixed soon).

 Anthony

 On Wednesday, July 20, 2011 5:38:18 AM UTC-4, sebastian wrote:

 Hi Anthony,

 I have not tested the trunk yet, but I have change those two lines

 other_request.vars = Storage(vars)
 other_request.get_vars = Storage(vars)

 I still get an error:
 invalid view (default/crud_in_comp.load)(in index.html)
 {{=LOAD('default','crud_in_**comp.load',ajax_trap=True)}}

 (in default.py)
 def crud_in_comp():
 return dict(crud=crud.create(db.auth_**user,message=None))

 any other file involved in that fix ?

 On Tue, Jul 19, 2011 at 9:39 PM, Anthony abas...@gmail.com wrote:

  Nightly build is not the same as trunk -- I'm not sure when it was last
 updated. You can pull trunk from the Google Code repository via Mercurial
 (you need to have Mercurial installed): http://code.google.com/p/**
 web2py/source/checkout http://code.google.com/p/web2py/source/checkout.
 Or you can just change the two relevant lines in your own copy of
 compileapp.py: http://code.google.com/p/**web2py/source/browse/gluon/**
 compileapp.py#126http://code.google.com/p/web2py/source/browse/gluon/compileapp.py#126(change
  lines 124-125 in 1.97.1 to what's in lines 126-127 in trunk) -- it
 just uses Storage(vars) in place of vars.

 Anthony

 On Tuesday, July 19, 2011 4:28:45 PM UTC-4, apple wrote:

 I downloaded the nightly build source and copied it on top of my
 web2py directory. Still get the request.vars as dict. Is that
 expected?

  On Jul 19, 5:40 pm, Anthony aba...@gmail.com wrote:
  Oops, forgot we already fixed that in trunk, so it will be work
 properly in
  the next release.
 
  Anthony
 
 
 
 
 
 
 
  On Tuesday, July 19, 2011 9:50:37 AM UTC-4, Anthony wrote:
   Good catch. I'll submit a patch.
 
   On Tuesday, July 19, 2011 8:56:08 AM UTC-4, apple wrote:
 
   I note that when ajax=False then request.vars is a dict rather than
 a
   storage object.
 
   On Jul 19, 11:44 am, apple sim...@gmail.com wrote:
The following works fine with the SQLFORM line and ajax=false or
ajax=true. However replacing SQLFORM line with the CRUD line it
 works
with ajax=true but fails with ajax=false, generating one of those

annoying restricted errors. I am guessing related to previous
 issue
with request.vars and load?
 
CONTROLLER
def test():
return dict()
def testload():
form=crud.update(db.customer,1)
#form=SQLFORM(db.customer,1)
return dict(form=XML(form.xml()))
TEST.HTML VIEW
{{extend 'layout.html'}}
{{=LOAD(c='crm',f='testload.**lo**ad', ajax=False,
 ajax_trap=True)}}
TESTLOAD.LOAD VIEW
{{=form}}




 --
 Sebastian E. Ovide







-- 
Sebastian E. Ovide


Re: [web2py] Re: A(cid=request.cid) inside a component inside another component ? bug or working as expected ?

2011-07-19 Thread Sebastian E. Ovide
Thanks Anthony

It looks like the problem was related to using
request.env.http_web2py_component_element instead of request.cid (I was
using request.env.http_web2py_component_element instead of request.cid as a
workaround of a bug in the previous version)...

now I know that request.env.http_web2py_component_element instead is not
exaclty the same as request.cid


just in case you want to reproduce it:

WELCOME/VIEWS/DEFAULT/COMP_IN.LOAD

{{=msg}}br/
{{=A('comp
IN',_href='comp_in.load',cid=request.env.http_web2py_component_element)}}



WELCOME/VIEWS/DEFAULT/COMP_OUT.LOAD

{{=LOAD('default','comp_in.load',ajax=False)}}
{{=A('comp
OUT',_href='comp_out.load',cid=request.env.http_web2py_component_element)}}
{{=LOAD('default','comp_in.load',ajax=False)}}
{{=A('comp
OUT',_href='comp_out.load',cid=request.env.http_web2py_component_element)}}
{{=LOAD('default','comp_in.load',ajax=False)}}
{{=A('comp
OUT',_href='comp_out.load',cid=request.env.http_web2py_component_element)}}



WELCOME/CONTROLLERS/DEFAULT.PY

def comp_out():
from datetime import datetime
return dict(msg=ciao from comp OUT at %s %(datetime.now()))

def comp_in():
from datetime import datetime
return dict(msg=ciao from comp IN at %s %(datetime.now()))


WELCOME/VIEWS/DEFAULT/INDEX.HTML

{{=LOAD('default','comp_out.load',ajax=False)}}

On Mon, Jul 18, 2011 at 11:58 PM, Anthony abasta...@gmail.com wrote:

 On Monday, July 18, 2011 3:18:44 PM UTC-4, sebastian wrote:

 H All,

 there is a component COMP_OUT which has a couple of A links with
 cid=request.cid. So that the result of A will be loaded inside the component
 itself.

 then there is another component COMP_IN which also has also some A links
 with cid=request.cid

 so far so good...

 now, I would like to use the component COMP_IN inside of the component
 COMP_OUT at this point there are cid conflicts and responses of the
 links (A) of the COMP_OUT are rendered in the wrong places (removing COMP_IN
 the links work again)


 Where are the COMP_OUT links rendering? They should be replacing the entire
 contents of COMP_OUT. Are you saying instead they are only replacing the
 contents of COMP_IN, or is the content going somewhere else?

 Are both of the components set to ajax=True?



 Is it a A(cid=request.cid) limitation or it is a bug ?

 (actually in the code I'm using cid=request.env.http_web2py_**
 component_elemen)


 Is this just a typo in your posting -- it should end with element (not
 elemen)?

 Maybe try specifying specific targets for each component, and reference
 those target names in your A() links to see if that works. For example:

 LOAD(..., target='outer')
 A(..., cid='outer')

 and

 LOAD(..., target='inner')
 A(..., cid='inner'


 Anthony




-- 
Sebastian E. Ovide


[web2py] LOADing a crud throws an error after upgrading to 1.97.1

2011-07-19 Thread Sebastian E. Ovide
Hi All,

I have a LOAD that was working fine with 1.96.last. I've just updated it to
1.97.1 and now it throws an error:

to reproduce it:

in the view
{{=LOAD('default','crud_in_comp.load',ajax_trap=True)}}

in the controller

def crud_in_comp():
return dict(crud=crud.create(db.auth_user,message=None))

any idea ?




-- 
Sebastian E. Ovide


Re: [web2py] Re: bug in crud with load and ajax=false

2011-07-19 Thread Sebastian E. Ovide
:D I've noticed it !

On Tue, Jul 19, 2011 at 9:40 PM, Anthony abasta...@gmail.com wrote:

 Right, not really updated nightly. I think that build was originally
 intended to encourage testing before new releases, but few people actually
 do any testing.

 Anthony

 On Tuesday, July 19, 2011 4:35:31 PM UTC-4, apple wrote:

 I just noticed all the files on the nightly build except directories
 are dated 26th June. Is this not updated nightly?

 On Jul 19, 9:28 pm, apple sim...@gmail.com wrote:
  I downloaded the nightly build source and copied it on top of my
  web2py directory. Still get the request.vars as dict. Is that
  expected?
 
  On Jul 19, 5:40 pm, Anthony abas...@gmail.com wrote:
 
 
 
 
 
 
 
   Oops, forgot we already fixed that in trunk, so it will be work
 properly in
   the next release.
 
   Anthony
 
   On Tuesday, July 19, 2011 9:50:37 AM UTC-4, Anthony wrote:
Good catch. I'll submit a patch.
 
On Tuesday, July 19, 2011 8:56:08 AM UTC-4, apple wrote:
 
I note that when ajax=False then request.vars is a dict rather than
 a
storage object.
 
On Jul 19, 11:44 am, apple sim...@gmail.com wrote:
 The following works fine with the SQLFORM line and ajax=false or
 ajax=true. However replacing SQLFORM line with the CRUD line it
 works
 with ajax=true but fails with ajax=false, generating one of those

 annoying restricted errors. I am guessing related to previous
 issue
 with request.vars and load?
 
 CONTROLLER
 def test():
 return dict()
 def testload():
 form=crud.update(db.customer,**1)
 #form=SQLFORM(db.customer,1)
 return dict(form=XML(form.xml()))
 TEST.HTML VIEW
 {{extend 'layout.html'}}
 {{=LOAD(c='crm',f='testload.**load', ajax=False,
 ajax_trap=True)}}
 TESTLOAD.LOAD VIEW
 {{=form}}




-- 
Sebastian E. Ovide


[web2py] A(cid=request.cid) inside a component inside another component ? bug or working as expected ?

2011-07-18 Thread Sebastian E. Ovide
H All,

there is a component COMP_OUT which has a couple of A links with
cid=request.cid. So that the result of A will be loaded inside the component
itself.

then there is another component COMP_IN which also has also some A links
with cid=request.cid

so far so good...

now, I would like to use the component COMP_IN inside of the component
COMP_OUT at this point there are cid conflicts and responses of the
links (A) of the COMP_OUT are rendered in the wrong places (removing COMP_IN
the links work again)

Is it a A(cid=request.cid) limitation or it is a bug ?

(actually in the code I'm using
cid=request.env.http_web2py_component_elemen)

thanks

-- 
Sebastian E. Ovide


Re: [web2py] Re: DAL: query sorted by calculated column ?

2011-07-18 Thread Sebastian E. Ovide
perfect, thanks cfh !

On Sun, Jul 17, 2011 at 10:45 PM, howesc how...@umich.edu wrote:

 i see 2 options:

 db.define_table('tabletest',  Field('yes', 'integer'), Field('no',
 'integer'), Field('tot', 'integer', compute=lambda r:r.yes-r.no))

 will compute the value upon write and store it in the db, sort like any
 other field.

 or

 db.define_table('tabletest',  Field('yes', 'integer'), Field('no',
 'integer'))

 class vf():
   def tot(self):
 return self.tabletest.yes-self.tabletest.no

 db.tabletest.virtualfields.append(vf)

 will create a virtual field that is computed on read.  to sort by the
 virtual field you can:

 db(db.tabletest.id0).select().sort(lambda r: r.tot)

 hope that helps.  (i did not test my code, just typed quickly, beware of
 typos)

 cfh




-- 
Sebastian E. Ovide


[web2py] DAL: query sorted by calculated column ?

2011-07-17 Thread Sebastian E. Ovide
Hi All,

is it possible to do something like this ?

select
num_yes,
num_no,
num_yes-num_no as tot
  from table
  order by tot

thanks

-- 
Sebastian E. Ovide


Re: [web2py] Re: OffTopic Google+

2011-07-06 Thread Sebastian E. Ovide
I'm not very sure about the effects that could have including some person to
the Acquaintances circle rather than to the Friends circle

On Wed, Jul 6, 2011 at 12:52 PM, Ross Peoples ross.peop...@gmail.comwrote:

 I have tried it. I like it better than Facebook, especially because of its
 commitment to privacy. The circles feature is great. I think most people
 don't friend their bosses, coworkers, and business acquaintances of Facebook
 because they don't want their personal lives to be exposed to those people.
 However, with Google+, you can friend everyone you know and only share your
 personal weekend drunken parties with your Friends (and maybe Family)
 circle.

 It's still missing a few key features (it is in beta after all), like the
 ability to write on someone's wall or send them a private message, but for
 the most part, it's pretty nice. I am really, REALLY pulling for Google
 here, as I hate Facebook.




-- 
Sebastian E. Ovide


Re: [web2py] Re: OffTopic Google+

2011-07-06 Thread Sebastian E. Ovide
yes circles is a good idea... just wondering if it possible to hide
which group each person is part of... so that for example the GF wont
complain of not being part of the very close friends circle... as in south
park facebook episode :D

http://www.youtube.com/watch?v=kT_cp2x0qsofeature=related

On Wed, Jul 6, 2011 at 7:56 PM, Ross Peoples ross.peop...@gmail.com wrote:

 Free, unlimited storage of photos as large as 2048x2048 and videos under 15
 in length is pretty awesome. This will be more than enough for most people.

 @sebastian:

 The point of the circles is so that you can share information with only
 certain groups if you want. So you could be friends with acquaintances so
 that you can always have their contact information and share related
 information with your acquaintances only. Then you could share personal
 information with your Friends and Family circles that you wouldn't want your
 acquaintances to know. The only way you could do such a thing with Facebook
 is if you had a business Facebook account, and a separate account for
 friends and families, but having two completely different accounts is a pain
 and somewhat impractical. I'm sure the hangout feature is cool and all (I
 haven't tried it yet), but Circles is the Facebook killing feature for me.




-- 
Sebastian E. Ovide


[web2py] login on dialog

2011-06-29 Thread Sebastian E. Ovide
Hi All,

is there an easy way to create a popup like dialog for logins ? I mean using
web2py auth

something like this: http://web2py.uservoice.com/forums/42577-general when
you click on like

thanks

-- 
Sebastian E. Ovide


Re: [web2py] suggestion for improvement for A

2011-06-28 Thread Sebastian E. Ovide
I mean the A function... say that you have a link which reload the
component... and the response takes few seconds... in these few seconds you
could click the link again... and it is not clear that it is loading
something

On Mon, Jun 27, 2011 at 11:30 PM, David J. da...@styleflare.com wrote:

 You can pass a loading image to the load function




 On 6/27/11 6:13 PM, Sebastian E. Ovide wrote:

 Hi All,

 some times a link A will reload a component (via cid=request.cid). In
 those situations would be nice to have some kind of loading message
 displayed.

 thanks

 --
 Sebastian E. Ovide








-- 
Sebastian E. Ovide


Re: [web2py] Re: proven hosting sites for web2py

2011-06-28 Thread Sebastian E. Ovide
I confirm that IPage has very poor technical support... nevertheless I've
installed web2py (with CGI) and it works ! even if it is VERY slow...  I
would not recommend it !

On Tue, Jun 28, 2011 at 8:51 PM, DenesL denes1...@yahoo.ca wrote:


 Sometimes it is like that, just a waste of time trying to figure out
 what is really supported behind all those marketing ads, and that is
 exactly why we should have this list of proven hosting sites.

 Thanks to all that have shared their experience so far.
 Keep it coming, there ought to be more.


 On Jun 28, 3:06 pm, GoldenTiger goldenboy...@gmail.com wrote:
  I did a large search over the net, chatting with technical support,
  doing next questions:
 
  1 –Python Version installed
  2- Possibility of install new modules? virtualenv?
  3- SSH shell enable? / HTTPs?
 
  I did copy/paste inhttp://blog.web2py.es  (my personal notes about
  web2py)
 
  Log with JustHosthttp://
 blog.web2py.es/hosting-web2py/buscando-hosting-web2py-justhost...
 
  Log with CirtexHosting.comhttp://
 blog.web2py.es/hosting-web2py/buscando-hosting-web2py-cirtexho...
 
  Log with IPage.comhttp://
 blog.web2py.es/hosting-web2py/buscando-hosting-web2py-www-ipag...
 
  More logs...http://blog.web2py.es/category/hosting-web2py/page/4/
 
  On Jun 28, 6:21 pm, Vasile Ermicioi elff...@gmail.com wrote:
 
 
 
 
 
 
 
   +1 for webfaction, soon I will post a website built with web2py and
 hosted
   by webfaction,
   I am very happy with them




-- 
Sebastian E. Ovide


Re: [web2py] suggestion for improvement for A

2011-06-28 Thread Sebastian E. Ovide
What about  adding a line in web2py_component (line 87 of web2py_ajax.js)

function web2py_component(action,target) {
  jQuery(function(){
  jQuery('#'+target).html(Loading...); // --- replace this
with some picture etc.
  web2py_ajax_page('get',action,null,target);
  });
}

would it break anything ?

On Tue, Jun 28, 2011 at 8:57 AM, Sebastian E. Ovide 
sebastian.ov...@gmail.com wrote:

 I mean the A function... say that you have a link which reload the
 component... and the response takes few seconds... in these few seconds you
 could click the link again... and it is not clear that it is loading
 something


 On Mon, Jun 27, 2011 at 11:30 PM, David J. da...@styleflare.com wrote:

 You can pass a loading image to the load function




 On 6/27/11 6:13 PM, Sebastian E. Ovide wrote:

 Hi All,

 some times a link A will reload a component (via cid=request.cid). In
 those situations would be nice to have some kind of loading message
 displayed.

 thanks

 --
 Sebastian E. Ovide








 --
 Sebastian E. Ovide







-- 
Sebastian E. Ovide


[web2py] suggestion for improvement for A

2011-06-27 Thread Sebastian E. Ovide
Hi All,

some times a link A will reload a component (via cid=request.cid). In those
situations would be nice to have some kind of loading message displayed.

thanks

-- 
Sebastian E. Ovide


Re: [web2py] Re: web2py with Eclipse

2011-06-27 Thread Sebastian E. Ovide
That's it !

thanks

On Mon, Jun 27, 2011 at 1:16 AM, Pierre Thibault pierre.thibau...@gmail.com
 wrote:

 from applications.soso.models.some_module import my_db_helper_here

 I'm sorry I forgot the some_module in my first example.




-- 
Sebastian E. Ovide


[web2py] how strongly coupled are LOAD with web2py_ajax.html and web2py_ajax.js ?

2011-06-26 Thread Sebastian E. Ovide
Hi All,

just wondering how strongly coupled are the web2py LOAD with the ajax
componetnts present in the applications... (web2py_ajax.html and
web2py_ajax.js for example)

I mean, would an old application that works fine with an old web2py, still
work on a newer web2py version which has changed also LOAD,
web2py_ajax.html and web2py_ajax.js ?

Just wondering how difficult would  maintaining one (many) application(s) be
as everytime that I've update I need to update web2py and update all the
applications static files related to web2py...

Thanks
-- 
Sebastian E. Ovide


Re: [web2py] Re: how strongly coupled are LOAD with web2py_ajax.html and web2py_ajax.js ?

2011-06-26 Thread Sebastian E. Ovide
great !

On Sun, Jun 26, 2011 at 10:01 PM, Anthony abasta...@gmail.com wrote:

 In general, when you upgrade to a new web2py version, you shouldn't need to
 update your applications, though you may want to in order to take advantage
 of some new features (or bug/security fixes).




-- 
Sebastian E. Ovide


Re: [web2py] Re: web2py with Eclipse

2011-06-26 Thread Sebastian E. Ovide
Thanks Pierr,

I was trying to do that but it is not working... actually I have a bunch of
imports insede that if 0 trick that solve all the web2py dependencies
errors...

the only errors stil there are those due to functions in my model files (as
for example the models of my plugins)

I've tried also

from applications.myapp.models import *

and added a __init__.py inside the models folder

any other ideas ?


On Sun, Jun 26, 2011 at 8:39 PM, Pierre Thibault pierre.thibau...@gmail.com
 wrote:


 if 0:
   from applications.myapp.models import myfunc




-- 
Sebastian E. Ovide


Re: [web2py] Re: web2py with Eclipse

2011-06-26 Thread Sebastian E. Ovide
add info:

from applications.soso.models import my_db_helper_here

eclipse give this error:

Unresolved import: my_db_helper_here
Unused import: my_db_helper_here

On Sun, Jun 26, 2011 at 11:43 PM, Sebastian E. Ovide 
sebastian.ov...@gmail.com wrote:

 Thanks Pierr,

 I was trying to do that but it is not working... actually I have a bunch of
 imports insede that if 0 trick that solve all the web2py dependencies
 errors...

 the only errors stil there are those due to functions in my model files (as
 for example the models of my plugins)

 I've tried also

 from applications.myapp.models import *

 and added a __init__.py inside the models folder

 any other ideas ?



 On Sun, Jun 26, 2011 at 8:39 PM, Pierre Thibault 
 pierre.thibau...@gmail.com wrote:


 if 0:
   from applications.myapp.models import myfunc




 --
 Sebastian E. Ovide







-- 
Sebastian E. Ovide


[web2py] let eclipse find global functions defined in model folder

2011-06-25 Thread Sebastian E. Ovide
Hi All,

I've add a bunch of imports into my plugin controller and model which fixed
all my eclipse errors. Now I've added a function into my plugin model but it
is not seen by Eclipse in my plugin controller.

any ideas ?

-- 
Sebastian E. Ovide


Re: [web2py] Re: For Massimo: which version of book to buy?

2011-06-24 Thread Sebastian E. Ovide
I like both paper to read while enjoying my sofa/bed. and online to
find quickly the information when I need it ;)

On Wed, Jun 22, 2011 at 12:45 PM, Paul Gerrard
p...@gerrardconsulting.comwrote:

 Call me old-fashioned, but I for one *prefer* the paper book to online
 8O)

 Online is a good fall-back if I can't find what I want.

 Things are moving quickly - when will the next paper version be
 available?

 Paul.




-- 
Sebastian E. Ovide


[web2py] update a field from a record from a table given all as parameters

2011-06-24 Thread Sebastian E. Ovide
Hi All,

how can I do something like this:


def update_my_field(tablename, columnname, id,value):
db.tablename(id).update_record(columnname=value)

update_my_field(my_table,my_column,123,hello world)



thanks
-- 
Sebastian E. Ovide


Re: [web2py] Re: update a field from a record from a table given all as parameters

2011-06-24 Thread Sebastian E. Ovide
I do not understand it, but it works !  (in the book says to do not confuse
update with update_record because for a single row, the method update updates
the row object but not the database record, as in the case of update_record)

Thanks !

On Fri, Jun 24, 2011 at 9:24 PM, Massimo Di Pierro 
massimo.dipie...@gmail.com wrote:

 def update_my_field(tablename, columnname, id,value):
 db(db[tablename].id==id).update(**{columnname:value})

 update_my_field(my_table,my_column,123,hello world)

 On Jun 24, 3:08 pm, Sebastian E. Ovide sebastian.ov...@gmail.com
 wrote:
  Hi All,
 
  how can I do something like this:
 
  def update_my_field(tablename, columnname, id,value):
  db.tablename(id).update_record(columnname=value)
 
  update_my_field(my_table,my_column,123,hello world)
 
  thanks
  --
  Sebastian E. Ovide




-- 
Sebastian E. Ovide


Re: [web2py] Re: Speed of rendering html data (10,000+ rows)

2011-06-21 Thread Sebastian E. Ovide
why you need to return 10k records in one go ?




-- 
Sebastian E. Ovide


[web2py] what is globals() ?

2011-06-21 Thread Sebastian E. Ovide
Hi All,

I see globals() everywhere and even if intuitively I guess what it is, I'd
like to find more info about it...

thanks

-- 
Sebastian E. Ovide


Re: [web2py] Re: For Massimo: which version of book to buy?

2011-06-18 Thread Sebastian E. Ovide
On Sat, Jun 18, 2011 at 3:33 AM, Massimo Di Pierro 
massimo.dipie...@gmail.com wrote:

 . Books on paper count. Books online do not.


wow  what about if we contribute to the online version and then you
repackage it in a paper version ?


  On Jun 17, 6:47 pm, mikech mp.ch...@gmail.com wrote:
  Wouldn't it be better at this point to use the online version and just
  contribute to the project using the link on the main page?




-- 
Sebastian E. Ovide


  1   2   3   >