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
girardinsamuel opened this issue
Jan 25, 2021
· 2 comments
· Fixed by #349
Labels
bugAn existing feature is not working as intendedmediumThese issues are geared for people who have contributed to the project beforeModelsThese issues relate to the Model portion of the ORM
>>> from app.User import User
>>> User.with_trashed().all()
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/Users/samuel/.pyenv/versions/pingcrm_masonite/lib/python3.9/site-packages/masoniteorm/models/Model.py", line 40, in __getattr__
return getattr(instantiated, attribute)
File "/Users/samuel/.pyenv/versions/pingcrm_masonite/lib/python3.9/site-packages/masoniteorm/models/Model.py", line 510, in __getattr__
raise AttributeError(f"class model '{name}' has no attribute {attribute}")
AttributeError: class model 'User' has no attribute with_trashed
But the soft deletes mixin is working otherwise. For example I can do this:
Or another solution would be to append the pass through to the model which append the __passthrough__ attribute. Either solution needs to be entirely done in that SoftDeleteMixin class. (or maybe even the SoftDeleteScope class)
josephmancuso
added
bug
An existing feature is not working as intended
Models
These issues relate to the Model portion of the ORM
medium
These issues are geared for people who have contributed to the project before
labels
Jan 25, 2021
bugAn existing feature is not working as intendedmediumThese issues are geared for people who have contributed to the project beforeModelsThese issues relate to the Model portion of the ORM
On a soft deletable User model I get this:
I observe also this error on the line shown in ORM documentation:
But the soft deletes mixin is working otherwise. For example I can do this:
Here is my model: https://github.com/girardinsamuel/pingcrm-masonite/blob/fix/3.0/app/User.py
The text was updated successfully, but these errors were encountered: