[tg-trunk] Re: tg2 model question

2007-12-16 Thread Alberto Valverde
iain duncan wrote: On Sat, 2007-15-12 at 19:39 -0500, Mark Ramm wrote: Here's what I figure I have to get in there to port my work so far: - SA 0.4 with assign_mapper equivalent syntax ( Foo.query.get_by() ) You'll need to use the DBSession.mapper (which is a contextual mapper) for this

[tg-trunk] Re: toscawidgets, thread_local SOLVED

2007-12-16 Thread Alberto Valverde
iain duncan wrote: On Sat, 2007-15-12 at 23:28 +, Alberto Valverde wrote: iain duncan wrote: I got toscawidgets working in the python shell ( as in I could call and render a widget ) and in the pylons simple toscawidget example, where the widget gets attached to that handy 'c' object.

[tg-trunk] Re: Validators, TG2 and callable

2007-12-16 Thread Alberto Valverde
iain duncan wrote: On Sat, 2007-15-12 at 23:37 +, Alberto Valverde wrote: percious wrote: In the old days of TG1 I wrote a function that was called by the @validate decorator, and then I would go into the Cherrypy request and pull out the information that I needed to send the appropriate

[tg-trunk] Re: tg2 model question

2007-12-16 Thread Jorge Godoy
Em Sunday 16 December 2007 08:24:35 Alberto Valverde escreveu: That looks like begging for trouble... I think you should use the same mapper instance on all models and the same DBSession. But shouldn't this work? I don't see why... Multiple sessions on the database, but every object in the

[tg-trunk] Re: tg2 model question

2007-12-16 Thread Alberto Valverde
Jorge Godoy wrote: Em Sunday 16 December 2007 08:24:35 Alberto Valverde escreveu: That looks like begging for trouble... I think you should use the same mapper instance on all models and the same DBSession. But shouldn't this work? I don't see why... Multiple sessions on the database,

[tg-trunk] Re: 1.0.4 final? Help wanted!

2007-12-16 Thread Christopher Arndt
Christoph Zwerschke schrieb: I agree with your assessment of the open issues in 1.0.4. I'll see whether I can add tests for #1628. Concerning the schedule, I would omit the rc1 since hardly anybody will do serious testing on New Year's Eve anyway; instead make b4 already the rc1 (just a

[tg-trunk] Re: help with metaclasses

2007-12-16 Thread John M Camara
On Dec 15, 7:37 pm, Alberto Valverde [EMAIL PROTECTED] wrote: bases = list(inspect.getmro(self.__class__)) I have had some issues with inspect.getmro in the past not providing the correct list in some cases so I would recommend using the mro method on the class. So in your example I would

[tg-trunk] Re: Validators, TG2 and callable

2007-12-16 Thread iain duncan
On Sun, 2007-16-12 at 12:34 -0800, percious wrote: Is it possible to post an some example code using pylons.c. I am having trouble getting it to work for me. Yeah, me too! ;-) iain --~--~-~--~~~---~--~~ You received this message because you are subscribed

[tg-trunk] TG2, logging config needs to be added to development.ini

2007-12-16 Thread iain duncan
FWIW, the current version of quickstarted controller and development.ini does not have logging enabled properly. I got it working by doing the following: - add to controller root.py: import logging log = logging.getLogger(__name__) - add to development.ini three entries above the current

[tg-trunk] Re: Validators, TG2 and callable

2007-12-16 Thread percious
Ok, so getting access to the request is no longer my problem. In the old days of tg 1.1 the @validator decorator could take a callable for the form argument, this seems to be removed. I tried to add it back but I am not getting the results I want. Is there a good reason that this was removed,

[tg-trunk] TG2, session vars not working out of the box

2007-12-16 Thread iain duncan
Not sure what I need to do, I can import pylons.session, and I can write to it, but on subsequent requests, it's and empty dict. If anyone knows what needs to happen to make those work, I'd love to hear it. On that note, I would also like to propose that whatever *can* work just like the pylons

[tg-trunk] Re: TG2, session vars working, my bad

2007-12-16 Thread iain duncan
So yeah, the beaker session needs an explicit save call and the first pylons docs I found on it didn't show it. But then others did. I'll add that to my list of things different from tg1 for upcoming docs. Thanks On Sun, 2007-16-12 at 18:01 -0800, iain duncan wrote: Not sure what I need to

[tg-trunk] Re: Validators, TG2 and callable

2007-12-16 Thread percious
Ok, so I hacked my own form validation into a copied validator and it works, so the proof of concept is there. I am using _ajax_form_parent_id to pick up the name of the form which works pretty well, but I am having a hard time getting claudio's ajax code to return a new form. Looking at the