-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
subclassing schema #115
Comments
It doesn't appear there are any other places that use the cache variables so should be ok? |
Found an issue, that was resolved with the following:
|
This could be a solution for the bug i reported here But if you inherit a lot of times the last class will have waste data inside:
C have this properties: i suggest to cache the name of the class and check if che cached name is the real name of the class
|
@overbost thanks for the feedback here, this is an awesome library but there do seem to be a few bugs in the meta. Mostly this relates to marshmallow for example. I generally agree its a good idea to make this class specific. In the solution above, I used the python behavior of appending a class name to a double underscore to facilitate this. The code above specifically sets a variable per class name on the class using lazy insanitation. I don't believe this will be set multiple times on inherited classes, however I would love to know if this is wrong :) I just ran a simple test case taking a class I previously called I have been meaning to create a PR for this but have been too busy. I would be happy to review and test a PR if you were willing to put one together! |
A note on subclassing. If you want to make a base class it is best to use When you are ready to create an actual ORM class you would inherit So your example would look like this, certainly not ideal but it works. There are similar issues in
|
Hey Again!
Found a bug (of my own making!), release 0.7.0 has this code:
This was the modifed code previously:
I'm for now hacking this in my own application code with the use of hidden class based variables, with dynamic lookup
I can hopefully create a PR for this change soon.
The text was updated successfully, but these errors were encountered: