File: __init__.py

package info (click to toggle)
sqlalchemy 0.6.3-3%2Bsqueeze1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 10,744 kB
  • ctags: 15,132
  • sloc: python: 93,431; ansic: 787; makefile: 137; xml: 17
file content (25 lines) | stat: -rw-r--r-- 845 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
"""

Examples illustrating the usage of the "association object" pattern,
where an intermediary object associates two endpoint objects together.

The first example illustrates a basic association from a User object
to a collection or Order objects, each which references a collection of Item objects.

The second example builds upon the first to add the Association Proxy extension.

E.g.::

    # create an order
    order = Order('john smith')

    # append an OrderItem association via the "itemassociations"
    # collection with a custom price.
    order.itemassociations.append(OrderItem(item('MySQL Crowbar'), 10.99))

    # append two more Items via the transparent "items" proxy, which
    # will create OrderItems automatically using the default price.
    order.items.append(item('SA Mug'))
    order.items.append(item('SA Hat'))

"""