summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/attributes.py
Commit message (Collapse)AuthorAgeFilesLines
* - attributes module and test suite moves underneath 'orm' packageMike Bayer2006-10-221-752/+0
| | | | | | | | | | | | | - fixed table comparison example in metadata.txt - docstrings all over the place - renamed mapper _getattrbycolumn/_setattrbycolumn to get_attr_by_column,set_attr_by_column - removed frommapper parameter from populate_instance(). the two operations can be performed separately - fix to examples/adjacencytree/byroot_tree.py to fire off lazy loaders upon load, to reduce query calling - added get(), get_by(), load() to MapperExtension - re-implemented ExtensionOption (called by extension() function) - redid _ExtensionCarrier to function dynamically based on __getattribute__ - added logging to attributes package, indicating the execution of a lazy callable - going to close [ticket:329]
* [ticket:324]Mike Bayer2006-10-051-3/+5
|
* various cleanup etc.Mike Bayer2006-10-041-1/+0
|
* - "custom list classes" is now implemented via the "collection_class"Mike Bayer2006-10-031-2/+5
| | | | | keyword argument to relation(). the old way still works but is deprecated [ticket:212]
* - added "mutable" flag to PickleType, set to False to allow old (faster) ↵Mike Bayer2006-09-231-4/+3
| | | | | | | behavior - fix attribute unit test - attributes have explicit flag for "mutable_scalars", propigated by ColumnProperty
* - added "pickleable" module to test suite to have cPickle-compatibleMike Bayer2006-09-231-10/+45
| | | | | | | | | | | | | | | | | | | | | | | | test objects - added copy_function, compare_function arguments to InstrumentedAttribute - added MutableType mixin, copy_value/compare_values methods to TypeEngine, PickleType - ColumnProperty and DeferredProperty propigate the TypeEngine copy/compare methods to the attribute instrumentation - cleanup of UnitOfWork, removed unused methods - UnitOfWork "dirty" list is calculated across the total collection of persistent objects when called, no longer has register_dirty. - attribute system can still report "modified" status fairly quickly, but does extra work for InstrumentedAttributes that have detected a "mutable" type where catching the __set__() event is not enough (i.e. PickleTypes) - attribute tracking modified to be more intelligent about detecting changes, particularly with mutable types. TypeEngine objects now take a greater role in defining how to compare two scalar instances, including the addition of a MutableType mixin which is implemented by PickleType. unit-of-work now tracks the "dirty" list as an expression of all persistent objects where the attribute manager detects changes. The basic issue thats fixed is detecting changes on PickleType objects, but also generalizes type handling and "modified" object checking to be more complete and extensible.
* - fixed unfortunate mutating-dictionary glitch from previous checkinMike Bayer2006-09-231-1/+1
| | | | | | - added "batch=True" flag to mapper; if False, save_obj will fully save one object at a time including calls to before_XXXX and after_XXXX
* future log linesMike Bayer2006-09-221-1/+1
|
* fix to reset_class_managed to look at noninherited attributes only; an ↵Mike Bayer2006-09-221-1/+10
| | | | artifact of compilation brought this up
* restored "optimistic" behavior of hasparent. its generally disastrous ↵Mike Bayer2006-09-051-5/+15
| | | | without that flag as its impossible to load all lazy loaders, deal with attributes that "noload", etc. just to check for orphan status.
* cleanup/unit test fixesMike Bayer2006-09-031-23/+35
|
* - further changes to attributes with regards to "trackparent". the "commit" ↵Mike Bayer2006-09-021-18/+13
| | | | | | | | | | operation now sets a "hasparent" flag for all attributes to all objects. that way lazy loads via callables get included in trackparent, and eager loads do as well because the mapper calls commit() on all objects at load time. this is a less shaky method than the "optimistic" thing in the previous commit, but uses more memory and involves more overhead. - some tweaks/cleanup to unit tests
* futher fix to the "orphan state" idea. to avoid setting tons ofMike Bayer2006-09-011-8/+19
| | | | | | | | | | "hasparent" flags on objects as they are loaded, both from lazy and eager loads, the "orphan" check now uses an "optimistic" flag to determine the result if no "hasparent" flag is found for a particular relationship on an instance. if the instance has an _instance_key and therefore was loaded from the database, it is assumed to not be an orphan unless a "False" hasparent flag has been set. if the instance does not have an _instance_key and is therefore transient/pending, it is assumed to be an orphan unless a "True" hasparent flag has been set.
* insure that "parent" pointers are set up on objects that were lazily loadedMike Bayer2006-09-011-2/+8
|
* adjusted __getstate__ on InstrumentedList to further avoid callables getting ↵Mike Bayer2006-08-081-4/+6
| | | | stuck in there...
* fixed small pickle bug with lazy loaders [ticket:265]Mike Bayer2006-08-061-2/+2
|
* [ticket:254]Mike Bayer2006-07-241-1/+1
|
* fixes to attributes/related so that get_history with passive=True returns noMike Bayer2006-06-301-12/+18
| | | | | AttributeHistory object if an untriggered callable was found (not sure how this used to work OK....)
* fixed attribute manager's ability to traverse the full set of managed ↵Mike Bayer2006-06-261-2/+3
| | | | attributes for a descendant class, + 2 unit tests
* more intelligent "removal" of list items when a list attribute is replaced, ↵Mike Bayer2006-06-161-10/+28
| | | | doesnt actually "remove" the items from teh replaced list just marks them as "removed" from the parent object for history purposes
* fixed bug where if a many-to-many table mapped as "secondary" had other cols ↵Mike Bayer2006-06-161-4/+6
| | | | in it, delete operations would try to match up on those columns. also fixed bug in new attributes if you set a list based attribute to a blank list, properly fires the 'delete' event for the elements of the previous list
* some adjustmentsMike Bayer2006-06-151-17/+24
|
* merged attributes rewriteMike Bayer2006-06-151-440/+543
|
* "parent track" function needed to be more specific to the parent classMike Bayer2006-06-101-2/+2
|
* merged 0.2 branch into trunk; 0.1 now in sqlalchemy/branches/rel_0_1Mike Bayer2006-05-251-45/+74
|
* the latest and greatest method to keep attributes from growingMike Bayer2006-04-271-22/+5
|
* fixed up expunge() and the continuing circular refs in attributes, added a ↵Mike Bayer2006-04-191-3/+3
| | | | unit test for the whole thing
* this assertion not really needed, esp. if a PickleType is used to take in a listMike Bayer2006-04-061-2/+2
|
* the ultimate "hands off" approach to the object's dictionary of managed ↵Mike Bayer2006-04-061-3/+25
| | | | attributes
* added 'entity_name' keyword argument to mapper. a mapper is now associated ↵Mike Bayer2006-04-031-0/+5
| | | | | | | | with a class via the class object as well as the optional entity_name parameter, which is a string defaulting to None. any number of primary mappers can be created for a class, qualified by the entity name. instances of those classes will issue all of their load and save operations through their entity_name-qualified mapper, and maintain separate identity from an otherwise equilvalent object.
* attributes overhaul #2 - attribute manager now tracks class-level ↵Mike Bayer2006-04-031-72/+64
| | | | initializers strictly through the SmartPropery instances attached to the class, so that attributes retain their natural polymorphic behavior. naming conventions migrating to "managed_attribute", simplifying codepaths.
* fixed reset_history method when applied to an attribute that had an ↵Mike Bayer2006-04-021-0/+3
| | | | attribute-level TriggeredAttribute set on it, added unit test.
* cleanup of attributes, better naming, added weak reference to base managed ↵Mike Bayer2006-04-011-78/+90
| | | | attribute to break circular refs, slightly shorter codepaths in some cases. added performance tester
* rework to expire() to make it smarter. when you expire(), history is ↵Mike Bayer2006-03-261-0/+6
| | | | immediately removed as well as explicit from dirty/deleted lists. this also changes uow.rollback_object() to remove from those lists, which is strange that it didnt do that before. anyway the mapper, when selecting and creating instances, asks the uow if this already identity-mapped instance is expired, and if so refreshes it on the fly, saving the need for the re-_get() operation, if some other query happens to touch upon the expired object. unit test added to confirm this.
* util: the __setitem__ method on historyarraylist was meaningless, surprising ↵Mike Bayer2006-03-261-3/+12
| | | | | | | | nobody noticed that. types: added PickleType, its slightly trickier than trivial, so OK now its standard. attributes: the level of pain if an AttributeError occurs inside a CallableProp, in combination with an object that implements __getattr__, is too deep for me to put the users through....so convert AttributeErrors to Assertions... engine: im not a fan of catching universal exceptions and squashing them
* removed circular loop in creating new list elements, fixes a common ↵Mike Bayer2006-03-251-2/+3
| | | | | | refresh() condition added None check in PropertyLoader many-to-one private deletion traversal, fixes byroot_tree (add a unit test for that)
* added expunge() method to objectstoreMike Bayer2006-03-251-1/+4
| | | | | correction in attributes reset_history to really reset in all cases added unit tests testing refresh()/expire() bug that was fixed by reset_history thing
* added overrideable managed_attribute_dict() function which can be changedMike Bayer2006-03-241-2/+9
| | | | to eliminate circular references on objects
* a few changes to attributes.py to allow faster initialization of object ↵Mike Bayer2006-03-211-6/+28
| | | | attributes on new objects
* fixed attributes bug where if an object is committed, its lazy-loaded list gotMike Bayer2006-03-141-1/+1
| | | | blown away if it hadnt been loaded
* added expire() function + unit test fixes [ticket:95]Mike Bayer2006-03-101-0/+10
|
* added exception importMike Bayer2006-03-101-0/+1
|
* added public-friendly setattr_clean and append_cleanMike Bayer2006-03-041-1/+9
|
* added objectstore.refresh(), including supporting changes in mapper, ↵Mike Bayer2006-03-021-1/+6
| | | | attributes, util
* some comments, changed SmartProperty to be smarter, UOWMike Bayer2006-02-191-19/+18
| | | | | version has "property" accessor which returns MapperProperty at the class level
* exception package added, support throughoutMike Bayer2006-02-191-1/+1
|
* one-to-one support:Mike Bayer2006-02-041-25/+17
| | | | | | | | | rolled the BackrefExtensions into a single GenericBackrefExtension to handle all combinations of list/nonlist properties (such as one-to-one) tweak to properties.py which may receive "None" as "added_items()", in the case of a scalar property instead of a list PropHistory masquerades as a List on the setattr/append delattr/remove side to make one-to-one's automatically work
* attempting to get MTOBackrefExtension to handle many-to-one, one-to-one equallyMike Bayer2006-02-031-2/+9
|
* fixed set() to not re-set the same valueMike Bayer2006-02-031-1/+4
|
* unset attributes on an object instance just return None instead of raising ↵Mike Bayer2006-01-201-2/+4
| | | | attributeerror