diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-01-14 21:21:02 +0000 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-01-14 21:21:02 +0000 |
| commit | 6584e033a9b232f5c273f206a5c7540c89e364e1 (patch) | |
| tree | 49aa23309b5baaed4ba6da6805ca229c2ed5feb0 /doc | |
| parent | 16f24ebbfc696f53567276731288cc635d2720b1 (diff) | |
| download | sqlalchemy-6584e033a9b232f5c273f206a5c7540c89e364e1.tar.gz | |
[ticket:398]
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/build/content/datamapping.txt | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/doc/build/content/datamapping.txt b/doc/build/content/datamapping.txt index 76937c87d..428c72d75 100644 --- a/doc/build/content/datamapping.txt +++ b/doc/build/content/datamapping.txt @@ -200,6 +200,8 @@ The mapped class can also specify whatever methods and/or constructor it wants: >>> u User id 1 name 'john' password 'foo' +Note that the **__init__() method is not called when the instance is loaded**. This is so that classes can define operations that are specific to their initial construction which are not re-called when the object is restored from the database, and is similar in concept to how Python's `pickle` module calls `__new__()` when deserializing instances. To allow `__init__()` to be called at object load time, or to define any other sort of on-load operation, create a `MapperExtension` which supplies the `create_instance()` method (see [advdatamapping_extending](rel:advdatamapping_extending), as well as the example in the FAQ). + SQLAlchemy will only put modified object attributes columns into the UPDATE statements generated upon flush. This is to conserve database traffic and also to successfully interact with a "deferred" attribute, which is a mapped object attribute against the mapper's primary table that isnt loaded until referenced by the application. ### Defining and Using Relationships {@name=relations} |
