I use to build a lot of dict that I use in my represent lambda... It was
easy when my models was in models, but now will I have to import my dict
every time or there is an other solution?

Richard

On Tue, Feb 14, 2012 at 4:04 PM, Richard Vézina <[email protected]
> wrote:

> Ok, I finally make it works... Don't why the Clientes listart() function
> wouldn't works, but moving the select into the controller function did the
> trick.
>
> So, instead of :
>
> #MODULE
>
> from gluon import *
>
> class Clientes(object):
>     """ Métodos de cliente """
>     def __init__(self, db):
>         self.db = db
>
>     def define_tables(self):
>         db = self.db
>         db.define_table('clientes',
>             Field('nombre','string'),
>             Field('apellido','string'))
>
> #    def listar(self):
> #        db = self.db
> #        return db(db.clientes>0).select() # I remove listar()
>
> Then  :
>
> Controller
>
> from client import Clientes
>
> def listed():
>     """Lista los Clientes"""
>     clientes = Clientes(db)
>     clientes.define_tables()
>     lista = db(db.clientes.id>0).select() # put the .select() here
>     return dict(lista=lista)
>
> Richard
>
>
>
> On Tue, Feb 14, 2012 at 12:55 PM, Richard Vézina <
> [email protected]> wrote:
>
>> Hello Martìn,
>>
>> As Sebastian said your slide is pretty cool, I download it and google
>> translate it to make sure I understand sometimes... :)
>>
>> I try to implement the slide example 1 and fall on this error :
>>
>> <type 'exceptions.AttributeError'> 'bool' object has no attribute
>> 'ignore_common_filters'
>>
>> I am under web2py 1.99.4 is this approach suppose to work with this
>> version? Particularly the new way to import from module??
>>
>> Thanks
>>
>> Richard
>>
>>
>>
>>
>> On Tue, Feb 7, 2012 at 6:35 AM, Martín Mulone <[email protected]>wrote:
>>
>>> 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. Also I worked in instant press from 1 year ago or more, and many
>>> other applications.
>>>
>>> In matter of scaling what I can say. Don't keep it with the basic. For
>>> me this is python and the important is the code, the beauty of the code,
>>> make sure that you application use modules, yes import is a great thing,
>>> this keep you code well order, take in mind nobody wants to read an awfull
>>> code, and in a future you can add new code and debug the problems easily.
>>> When you have a big app, models are not a good idea, this is why some
>>> experience developers quite from using web2py, the problem is that are
>>> giving up too fast, because you can avoid using models in web2py app, or at
>>> least using elemental models. You can read more why in my slides from last
>>> pycon at argentina
>>> http://www.slideshare.net/martinpm/web2py-pensando-en-grande-9448110.
>>> Also you can read examples like lessmodel application that bruno rocha made
>>> or the plugin aproach by kenshi here
>>> http://dev.s-cubism.com/plugin_jstree.
>>>
>>> Scheduler is another great piece of code, it's small but pretty
>>> powerfull, It's really nice and I use a lot. I don't know why the people
>>> are not using more. You can run a long time task to avoid timeout of the
>>> server and client with long tasks.
>>>
>>> Dal, well in my experience is great but not always I can use full of it.
>>> Many times I have heavly or complex queries that I have to pass it with
>>> executesql. But dal is working pretty well with this mix.
>>>
>>> About "breakage" when upgrating web2py, yes I have some, but it's my
>>> fault because sometimes I'm using experimental features and not stable, I
>>> want always the last features, I remember scheduler and grid give me some
>>> trouble with this. But in generally I have running application of about 2-3
>>> years ago with the last version.
>>>
>>> 2012/2/3 howesc <[email protected]>
>>>
>>>> i don't know of any blogs that discuss the experiences of users over
>>>> the long term.  i suspect this group history might be an indication.  heck,
>>>> check my posts over the past couple of years - whenever i hit bumps in the
>>>> road i tend to ask questions here.
>>>>
>>>> are there specific things we can help answer?  i have used web2py for 4
>>>> live production projects (and a few toys along the way), 3 of the 4 are on
>>>> google app engine, and one of the 4 sees a sustained 60 requests a second
>>>> average, so i've been using it all heavily (though not always the most up
>>>> to date, i'm slow at incorporating new features).
>>>>
>>>> cfh
>>>>
>>>
>>>
>>>
>>> --
>>>  http://www.tecnodoc.com.ar
>>>
>>>
>>
>

Reply via email to