Jaymon / prom

A PostgreSQL or SQLite orm for Python
MIT License
22 stars 4 forks source link

config.Field names #143

Closed Jaymon closed 1 year ago

Jaymon commented 2 years ago

python3 has a descriptor __set_name__() magic method that will tell the descriptor what the name is, I should switch my logic to use this

Jaymon commented 1 year ago

This should absolutely by used, the field should be updated with this:

def __set_name__(self, orm_class, name):
    self.orm_class = orm_class
    self.name = name