-
Notifications
You must be signed in to change notification settings - Fork 80
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
More fixes on the Qiita(Status)Object classes #73
Conversation
""" | ||
if not self._check_id(id_): | ||
raise QiitaDBObjectDoesNotExistsError(id_, self._table) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is a hugely long error name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, I had the same feeling. Do we actually need to prefix the error with QiitaDB
? Then we can have:
ObjectDoesNotExistsError
, which is a bit better...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinking a bit more, QiitaDBUnknownIDError
looks better...
A few comments, overall looks good. |
Thanks @squirrelo I've solved your comments. |
Seems good |
looks like we have 2 👍 can somebody take a quick look and merge? |
More fixes on the Qiita(Status)Object classes
Some fixes on the QiitaObject and QiitaStatusObject base classes:
__init__
on the QiitaObject class now checks that theid
passed actually belongs to an object in the database._status_setter_checks
that should be overwritten by the subclasses in order to perform the necessary checks before updating the DB object.check_status
decorator was not working. Rewriting it to be just a boolean function, so subclasses can call it when needed.It would be great if this can be in soon, as it should be merged before any other object is merged.