I sat down today to do a real registration page for codemill and (possibly the start of tgext.registation)
here is what I got so far http://paste.turbogears.org/paste/38205 which is very disappointing :( 71 LOC and some very cryptic ones. Some comments/questions 1- Why can't the "declarative" syntax for sprox assume the __model__ attr is given by Class.model ? (-6 LOC) 2- We need a better way to attach a predicate to a exposed method, +4 LOC for each one is not fun. 3- why repoze.what made All ? can't we use any/all from python we have plenty of ways of providing that in the TG1 codebase 4- look at how awful is that custom predicate to simply figure out if the current user is the one trying to be edited, I have left the pprint in there to give you an idea of how horrible it was for me to find out how to query for him. 4.1- why is repoze.what.userid == User.user_name ?? 4.2- there was to be a better way to know if the current user is able to edit the current resource 4.3- my code is very very ugly and will probably break in a very easy way. like going to (http://localhost:8080/register/edit) 5- Why do we need to pass the DBSession so many times? The controller needs it as well as all the form instances? 6- I couldn't think of a sane way of doing if user = admin: edit_form = full_user_form elif user = current: edit_form = limited_user_form else: abort(403) Thoughts? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
