You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The beginning .. in ..some.classpath.to.Bar would be a relative classpath because it is relative from the local module.
I remember I tried to implement this and failed, this was the best commit message I could find:
3bc5d90 (this has all the code I had implemented for Query.ref)
sigh, reverts Query.ref being able to take a relative classpath because Field(classpath) can't be relative and there really isn't any way to ever make that work, and I would rather they be consistent
So I think the problem was the fields didn't know from what module and class they were being defined in and so couldn't do a relative import.
I think this would be worth looking into again.
Here are some other commits that might be helpful:
7b1c6f3 - "updates utils.get_objects() to support relative classpaths also"
065f274 - "turns out I hadn't really made the relative importing useful for the query, so Query.ref will now use the Query.orm_class and its parents to attempt to resolve relative classpaths"
The thing that made me think this might be worth revisiting is pkgutil.resolve_name(name) and I also know there are some python later versions of 3+ that make it easier for the descriptor to find out the name of the field it is being created for and things like that. So relative classpaths might be possible now.
The text was updated successfully, but these errors were encountered:
First, what is a relative classpath? It's doing something like this:
The beginning
..
in..some.classpath.to.Bar
would be a relative classpath because it is relative from the local module.I remember I tried to implement this and failed, this was the best commit message I could find:
3bc5d90 (this has all the code I had implemented for Query.ref)
So I think the problem was the fields didn't know from what module and class they were being defined in and so couldn't do a relative import.
I think this would be worth looking into again.
Here are some other commits that might be helpful:
The thing that made me think this might be worth revisiting is pkgutil.resolve_name(name) and I also know there are some python later versions of 3+ that make it easier for the descriptor to find out the name of the field it is being created for and things like that. So relative classpaths might be possible now.
The text was updated successfully, but these errors were encountered: