rename alias manager
This commit is contained in:
@ -79,13 +79,13 @@ But don't worry - ormar can handle situations like this, as it uses the Relation
|
||||
Each class is registered with the same instance of the AliasManager that you can access like this:
|
||||
|
||||
```python
|
||||
SchoolClass._orm_relationship_manager
|
||||
SchoolClass.alias_manager
|
||||
```
|
||||
|
||||
It's the same object for all `Models`
|
||||
|
||||
```python
|
||||
print(Teacher._orm_relationship_manager == Student._orm_relationship_manager)
|
||||
print(Teacher.alias_manager == Student.alias_manager)
|
||||
# will produce: True
|
||||
```
|
||||
|
||||
@ -94,11 +94,11 @@ print(Teacher._orm_relationship_manager == Student._orm_relationship_manager)
|
||||
You can even preview the alias used for any relation by passing two tables names.
|
||||
|
||||
```python
|
||||
print(Teacher._orm_relationship_manager.resolve_relation_join(
|
||||
print(Teacher.alias_manager.resolve_relation_join(
|
||||
'students', 'categories'))
|
||||
# will produce: KId1c6 (sample value)
|
||||
|
||||
print(Teacher._orm_relationship_manager.resolve_relation_join(
|
||||
print(Teacher.alias_manager.resolve_relation_join(
|
||||
'categories', 'students'))
|
||||
# will produce: EFccd5 (sample value)
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user