[Checkins] SVN: z3c.formjs/trunk/src/z3c/formjs/ajax.py Fixed helper function to correctly handle the no-name case.

Stephan Richter srichter at cosmos.phy.tufts.edu
Thu May 29 08:49:27 EDT 2008


Log message for revision 87028:
  Fixed helper function to correctly handle the no-name case.
  

Changed:
  U   z3c.formjs/trunk/src/z3c/formjs/ajax.py

-=-
Modified: z3c.formjs/trunk/src/z3c/formjs/ajax.py
===================================================================
--- z3c.formjs/trunk/src/z3c/formjs/ajax.py	2008-05-29 12:01:03 UTC (rev 87027)
+++ z3c.formjs/trunk/src/z3c/formjs/ajax.py	2008-05-29 12:49:27 UTC (rev 87028)
@@ -33,8 +33,10 @@
 def getUniquePrefixer(n=2, prefix='form'):
     def createPrefix(form):
         parents = getParents(form)
-        return prefix + ''.join([createCSSId(getattr(obj, '__name__', obj.__class__.__name__))
-                                 for obj in parents[:n]])
+        return prefix + ''.join(
+            [createCSSId(getattr(obj, '__name__', None)
+                         or obj.__class__.__name__)
+             for obj in parents[:n]])
     return createPrefix
 
 



More information about the Checkins mailing list