2012/10/3 Douglas Cerna <[email protected]>: > Justas: > > After our meeting today, I kept testing my done_link fix to the group index > view and realized that when the Members search box is used, the URL of the > request changes to be something like: > > http://.../groups/students/@@index.html/ajax/view/context/members/group_aware_person_table > > so when using the ajax part, request.URL doesn't make sense anymore for > getting the done_link. > > So I thought "I should just use the group url", and then I realized that the > "table formatter" doesn't have access to the view nor the view.context. > > So I tried this approach, which I'm very comfortable with in JS, but haven't > used so much in Python, where you return a function from another function. > Here's the commit: > > http://bazaar.launchpad.net/~schooltool-owners/schooltool/flourish/revision/3483/src/schooltool/group/browser/group.py > > Is there a better way to do this? Thanks.
This is called closure and is all good and used elsewhere in schooltool. > > Douglas > > "... allí es cuando te das cuenta que las cosas malas pueden resultar > bastante buenas..." - Lionel Messi > > Por favor, evite enviarme adjuntos de Word, Excel o PowerPoint. > Vea http://www.gnu.org/philosophy/no-word-attachments.es.html > > _______________________________________________ > Mailing list: https://launchpad.net/~schooltool-developers > Post to : [email protected] > Unsubscribe : https://launchpad.net/~schooltool-developers > More help : https://help.launchpad.net/ListHelp -- Gediminas _______________________________________________ Mailing list: https://launchpad.net/~schooltool-developers Post to : [email protected] Unsubscribe : https://launchpad.net/~schooltool-developers More help : https://help.launchpad.net/ListHelp

