Release: 1.3.24 | Release Date: March 30, 2021

SQLAlchemy 1.3 Documentation

SQLAlchemy 1.3 Documentation

Home

SQLAlchemy ORM

  • Object Relational Tutorial
  • Mapper Configuration
  • Relationship Configuration¶
    • Basic Relationship Patterns
    • Adjacency List Relationships
    • Linking Relationships with Backref
    • Configuring how Relationship Joins
    • Collection Configuration and Techniques
    • Special Relationship Persistence Patterns
    • Relationships API
  • Loading Objects
  • Using the Session
  • Events and Internals
  • ORM Extensions
  • ORM Examples

Home

  • Previous: Class Mapping API
  • Next: Basic Relationship Patterns
  • Up: Home
    • SQLAlchemy ORM
  • On this page:
    • Relationship Configuration

Relationship Configuration¶

This section describes the relationship() function and in depth discussion of its usage. For an introduction to relationships, start with the Object Relational Tutorial and head into Building a Relationship.

  • Basic Relationship Patterns
    • One To Many
    • Many To One
    • One To One
    • Many To Many
    • Association Object
  • Adjacency List Relationships
    • Composite Adjacency Lists
    • Self-Referential Query Strategies
    • Configuring Self-Referential Eager Loading
  • Linking Relationships with Backref
    • Backref Arguments
    • Setting cascade for backrefs
    • One Way Backrefs
  • Configuring how Relationship Joins
    • Handling Multiple Join Paths
    • Specifying Alternate Join Conditions
    • Creating Custom Foreign Conditions
    • Using custom operators in join conditions
    • Custom operators based on SQL functions
    • Overlapping Foreign Keys
    • Non-relational Comparisons / Materialized Path
    • Self-Referential Many-to-Many Relationship
    • Composite “Secondary” Joins
    • Relationship to Aliased Class
    • Row-Limited Relationships with Window Functions
    • Building Query-Enabled Properties
  • Collection Configuration and Techniques
    • Working with Large Collections
    • Customizing Collection Access
    • Custom Collection Implementations
    • Collection Internals
  • Special Relationship Persistence Patterns
    • Rows that point to themselves / Mutually Dependent Rows
    • Mutable Primary Keys / Update Cascades
  • Relationships API
    • relationship()
    • backref()
    • relation()
    • dynamic_loader()
    • foreign()
    • remote()
Previous: Class Mapping API Next: Basic Relationship Patterns
© Copyright 2007-2021, the SQLAlchemy authors and contributors.

flambé! the dragon and The Alchemist image designs created and generously donated by Rotem Yaari.

Created using Sphinx 7.2.6. Documentation last generated: Tue 19 Dec 2023 07:05:39 PM