Commits

Gael Pasgrimaud committed be5202e

trailing spaces

Comments (0)

Files changed (3)

formalchemy/fields.py

     def cache(self, *args, **kwargs):
         if hasattr(self, '_deserialization_result'):
             return self._deserialization_result
-               
+
         self._deserialization_result = func(self, *args, **kwargs)
 
         return self._deserialization_result
 
         The `name` of a field will always look like:
           [fieldset_prefix-]ModelName-[pk]-fieldname
-        
+
         The fieldset_prefix is defined when instantiating the
         `FieldSet` object, by passing the `prefix=` keyword argument.
 
          same page. You can however, create more than one object
          of a certain class, provided that you create multiple FieldSet
          instances and pass the `prefix=` keyword argument.
-         
+
          Otherwise, FormAlchemy deals very well with editing multiple
          existing objects of same/different types on the same page,
          without any name clash. Just be careful with multiple object
         """
         if not self.field.is_readonly() and self.params is not None:
             # submitted value.  do not deserialize here since that requires valid data, which we might not have
-            v = self._serialized_value() 
+            v = self._serialized_value()
         else:
             v = None
         # empty field will be '' -- use default value there, too
     @property
     def params(self):
         """This gives access to the POSTed data, as received from
-        the web user. You should call `.getone`, or `.getall` to 
+        the web user. You should call `.getone`, or `.getall` to
         retrieve a single value or multiple values for a given
         key.
 
         decorator, provided using:
 
         .. sourcecode:: py
-       
+
           from formalchemy.fields import deserialize_once
 
           @deserialize_once
     """render a field as radio"""
     widget = staticmethod(h.radio_button)
     format = '%(field)s%(label)s'
-    
+
     def _serialized_value(self):
         if self.name not in self.params:
             return None
     return attr
 
 def _pk(instance):
-    # Return the value of this instance's primary key, suitable for passing to Query.get().  
+    # Return the value of this instance's primary key, suitable for passing to Query.get().
     # Will be a tuple if PK is multicolumn.
     try:
         columns = class_mapper(type(instance)).primary_key
         cls = node.__class__
         meth = getattr(self,'visit'+cls.__name__,self.default)
         return meth(node, **kw)
-            
+
     def default(self, node, **kw):
         for child in node.getChildNodes():
             return self.visit(child, **kw)
-            
+
     visitExpression = default
-    
+
     def visitName(self, node, **kw):
         if node.name in ['True', 'False', 'None']:
             return eval(node.name)
 
     def visitTuple(self,node, **kw):
         return tuple(self.visit(i) for i in node.nodes)
-        
+
     def visitList(self,node, **kw):
         return [self.visit(i) for i in node.nodes]
 
         a list of the primary key values of the items in the collection is returned.
 
         Invalid form data will cause an error to be raised.  Controllers should thus validate first.
-        Renderers should thus never access .value; use .model_value instead.  
+        Renderers should thus never access .value; use .model_value instead.
         """
         # TODO add ._validated flag to save users from themselves?
         if not self.is_readonly() and self.parent.data is not None:
     def raw_value(self):
         """
         raw value from model.  different from `.model_value` in SQLAlchemy fields, because for reference types,
-        `.model_value` will return the foreign key ID.  This will return the actual object 
+        `.model_value` will return the foreign key ID.  This will return the actual object
         referenced instead.
         """
         raise NotImplementedError()
         """
         Create a new Field object.
 
-        - `name`: 
+        - `name`:
               field name
 
-        - `type=types.String`: 
+        - `type=types.String`:
               data type, from formalchemy.types (Integer, Float, String, Binary,
               Boolean, Date, DateTime, Time) or a custom type
 
-        - `value=None`: 
+        - `value=None`:
               default value.  If value is a callable, it will be passed the current
               bound model instance when the value is read.  This allows creating a
               Field whose value depends on the model once, then binding different

formalchemy/forms.py

         to know about the entire form.  The other parameters are passed directly
         to `ModelRenderer.configure`.
 
-        - `pk=False`: 
+        - `pk=False`:
               set to True to include primary key columns
 
-        - `exclude=[]`: 
+        - `exclude=[]`:
               an iterable of attributes to exclude.  Other attributes will
               be rendered normally
 
-        - `include=[]`: 
+        - `include=[]`:
               an iterable of attributes to include.  Other attributes will
               not be rendered
 
-        - `options=[]`: 
+        - `options=[]`:
               an iterable of modified attributes.  The set of attributes to
               be rendered is unaffected
 
-        - `global_validator=None`: 
+        - `global_validator=None`:
               `global_validator` should be a function that performs
               validations that need to know about the entire form.
 
         Only one of {`include`, `exclude`} may be specified.
-        
+
         Note that there is no option to include foreign keys.  This is
         deliberate.  Use `include` if you really need to manually edit FKs.
 
         in `include`.  Otherwise, fields will be rendered in order of declaration,
         with table fields before mapped properties.  (However, mapped property order
         is sometimes ambiguous, e.g. when backref is involved.  In these cases,
-        FormAlchemy will take its best guess, but you may have to force the 
+        FormAlchemy will take its best guess, but you may have to force the
         "right" order with `include`.)
 
         """
 
         This `configure` adds two parameters:
 
-        - `focus=True`: 
+        - `focus=True`:
               the attribute (e.g., `fs.orders`) whose rendered input element
               gets focus. Default value is True, meaning, focus the first
               element. False means do not focus at all.

formalchemy/tables.py

         from sqlalchemy.orm import class_mapper
         if not class_mapper(cls):
             raise Exception('Grid must be bound to an SA mapped class')
-        base.EditableRenderer.__init__(self, cls, session, data, prefix) 
+        base.EditableRenderer.__init__(self, cls, session, data, prefix)
         self.rows = instances
         self.readonly = False
         self.errors = {}
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.