Open knyghty opened 2 years ago
@sbdchd just curious, what would it take to enable this?
Essentially, making it so we don't have to manually define id: int
on all our models? We'd have to read the related_name
somehow and inform the type system beforehand, right?
Not really sure how to do it without some codegen aspect
problem is really lack of advanced stuff in python typing and how Django sets this stuff up
I tried to solve something like this using codegen. See https://github.com/sbdchd/django-types/issues/158 if you are interested. Note that I'm not currently working on this -- just putting out what I created for those who are interested.
Two I can think of offhand:
get_FOO_display()
for choicesfoo_id
where you have aForeignKey
calledfoo
I'm making a bit of an assumption that this is possible - I don't really know.