Changes between Version 3 and Version 4 of BluePrintLazyRepresentation


Ignore:
Timestamp:
12/18/12 20:33:00 (9 years ago)
Author:
Dominic König
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • BluePrintLazyRepresentation

    v3 v4  
    9393== Implementation ==
    9494
     95=== S3Represent Base Class ===
     96
    9597Having to define an individual bulk representation class for each and every Field seems though a little too much effort, so this calls for a base-class that already covers the standard case:
    9698
     
    104106
    105107S3Represent is defined in s3fields.py, and is therefore available in every model (controllers need to use s3base.S3Represent).
     108
     109=== Usage ===
    106110
    107111The base class takes the following configuration parameters:
     
    119123||none||current.messages.NONE||the default for None-values (or empty lists for list: types||||
    120124
    121 S3Represent can be subclassed to meet specific requirements. Usually, the subclass would overwrite some of these methods:
     125=== Subclassing S3Represent ===
     126
     127S3Represent can be subclassed to meet specific requirements.
     128
     129Usually, the subclass would overwrite some of these methods:
     130
     131==== lookup_rows() ====
    122132
    123133{{{
     
    136146  - ''For testing/benchmarking, lookup_rows() should increment self.queries for each query performed.''
    137147
     148==== represent_row() ====
     149
    138150{{{
    139151    def represent_row(self, row):
     
    146158
    147159This function receives each row retrieved by lookup_rows() and should return the string representation. It should '''not''' perform any additional DB lookups. It should return a lazyT if self.translate is True.
     160
     161==== link() ====
    148162
    149163{{{