iain duncan wrote:
> Hey folks, I realize I'm being a big pest here and I appreciate the
> indulgences. The scoop is that I need to establish whether porting my
> base framework to TG2 is realistic for three upcoming projects that will
> take up most of my time for the next six months, so I'd really like to
> avoid porting them halfway through. However, I need to know within the
> next week or so if I don't want to have to manage multiple disparate
> code bases ...
I'll second what Florent has already said: Me for another one don't find
your questions annoying at all :)
>
> In return for getting these pesky questions answered, I'm going to turn
> them into a simple TG2 sample app that covers everything I can think of
> for the user coming to TG2 and I will will put it online, with a test
> suite and commenting aimed at a newbie, so we can make sure that it is
> constantly working and there is an approachable point for those who like
> to work from examples. I think this will also be a good internal tool
> for my (small) team of coffee huffing freelancers out here in the BC
> rain.
That would be awesome and I'm sure many will appreciate your effort.
>
> 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 (just in case you haven't figured that out already)
> - toscawidgets with genshi, maybe mako
Feel free to join toscawidgets-discuss google group :)
> - redirects with whatever our flash() equivalent is
It's not yet there AFAIK but I have a working version in an app of mine
which I plan to integrate into TG before or during the sprint (if time
allows... my sprint-TODO-list keeps on growing all the time ;)
> - validation and error handling, both with decorator and within a method
> in the case of unknown form length
The validate() decorator is yet another TODO of mine... TG2 won't have
(AFAIK) error handling as we know it in TG1 because one of the goals of
TG2 is to simplify all the decorator-madness we have in TG1. TG1s error
handling, although being insanely clever and powerful, is somewhat
difficult to maintain because of the magic it needs to employ to achieve
what it does.
What I'm planning to implement in the validate() decorator for TG2 is a
much simpler and less powerful (but powerful enough, at least for the
use-cases I've had) cross-breed between Pylons, TW's and TG1s validate()
decorator. It would be used like:
@validate(my_form, error_handler="show_form")
def process_form(self, **kw)
....
There, error_handler is the *name* of the method, which must live in the
same controller, that will redisplay the form in case of errors. This is
the Pylons' heritage. The TG heritage comes from the fact that the
validated values will be passed as arguments to the function (instead of
being bound to the controller like Pylons does) and TW's phenotype is
seen as the "form" argument which is a TW form (or any object that has a
"validate" method)
Comments on this welcomed... :)
> - authkit? some form of login/registration/authorization
I believe TG1s @identity decorator and predicate semantics can be easily
implemented on top of authkit and will be much less code than the actual
identity code since authkit already takes care of all the grunt
authentication work... I think this task is best suited to someone who
actually uses identity (or is willing to contract me to do it and is
willing to donate the code back to the community ;)
> - image uploading
> - paste test fixtures for unit/functional/integration tests
> - rock solid deployment plan
Oh boy! This is one of Pylons/PasteDeploy's aspects I like the most :)
> - unicode throughout ( my ignorance being the problem here, not TG2 )
Hmmm, Maybe it will also be a good idea to show-off Babel in action for
i18n here...
Alberto
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears Trunk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears-trunk?hl=en
-~----------~----~----~----~------~----~------~--~---