rename alias manager

This commit is contained in:
collerek
2020-08-26 14:33:46 +02:00
parent 63a24e7d36
commit a9f88e8f8f
8 changed files with 11 additions and 20 deletions

View File

@ -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)
```