mirror of
https://github.com/sqlalchemy/sqlalchemy.git
synced 2026-05-14 04:37:15 -04:00
40f8aadd58
- added READMEs to all examples in each __init__.py and added to sphinx documentation - added versioning example - removed vertical/vertical.py, the dictlikes are more straightforward
11 lines
538 B
Python
11 lines
538 B
Python
"""Illustrates a clever technique using Python descriptors to create custom attributes representing SQL expressions when used at the class level, and Python expressions when used at the instance level. In some cases this technique replaces the need to configure the attribute in the mapping, instead relying upon ordinary Python behavior to create custom expression components.
|
|
|
|
E.g.::
|
|
|
|
class BaseInterval(object):
|
|
@hybrid
|
|
def contains(self,point):
|
|
return (self.start <= point) & (point < self.end)
|
|
|
|
"""
|