Difference between revisions of "Interesting Python"

From PeformIQ Upgrade
Jump to navigation Jump to search
Line 1: Line 1:
= Some Twisty Code =
= Some Twisty Code =


<html>
 
   def insert(self, row):
   def insert(self, row):
       field_values = ", ".join(['%s="%%(%s)s"' % (f, f) for f in self.field_names
       field_values = ", ".join(['%s="%%(%s)s"' % (f, f) for f in self.field_names


</html>


<nowiki>
 
 
       return [self.syn_record_class(list(r) +
       return [self.syn_record_class(list(r) +
                             [s[1](self.record_class(r)) for s in self.syn_fields])
                             [s[1](self.record_class(r)) for s in self.syn_fields])
                   for r in c.fetchall()]
                   for r in c.fetchall()]
</nowiki>

Revision as of 14:44, 20 December 2007

Some Twisty Code

  def insert(self, row):
     field_values = ", ".join(['%s="%%(%s)s"' % (f, f) for f in self.field_names



     return [self.syn_record_class(list(r) +
                            [s[1](self.record_class(r)) for s in self.syn_fields])
                 for r in c.fetchall()]