Working with django 1.0 and google app engine… Wanted to set every view on my admin page to have admin permission. def _perm_admin(rootfunc) : import sys module = sys.modules.get(rootfunc.__module__) for key, value in module.__dict__.items() : if type(value) is types.FunctionType and key[0] != ‘_’ and rootfunc.__module__ == value.__module__: module.__dict__[key] = permission_required(’admin’)(value) _perm_admin(main)
Entries from September 2008
Set permission_required for your view functions
September 22nd, 2008
Python Documentation — Fail!
September 5th, 2008
One of many rants against python documentation. Fundamentally, things like this only re-enforce why it didn’t receive the rapid acceptance of PHP. $ pydoc list …. | index(…) | L.index(value, [start, [stop]]) -> integer — return first index of value …. Ok, that’s good… But what about the “not found” case, is it documented, nope! [...]
Tags: python
Honor Role … or Killer …
September 4th, 2008
I was driving down the road the other day and saw this bumper sticker on a car… We’ve all see “Proud Parent of a XYZ School Honor Role” bumper stickers. This was the first time that I saw a bumper sticker that somebody was proud that their child was a professional killer. While fundamentally I [...]
Tags:




