Skip to content
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

Add exists classmethod #64

Merged
merged 2 commits into from May 30, 2014
Merged

Add exists classmethod #64

merged 2 commits into from May 30, 2014

Conversation

josenavas
Copy link
Contributor

Changes the create and delete methods of the base class from @staticmethod to @classmethod.
It adds a new @classmethod: exists. This methods is useful to avoid inserting the same information twice in the DB. Will be needed later to avoid running the same analysis/job twice for example.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.06%) when pulling 0b50660 on josenavas:exists into 1138445 on biocore:master.

@josenavas
Copy link
Contributor Author

Is somebody available for a fast review on this one?

@wasade
Copy link
Contributor

wasade commented May 30, 2014

these methods don't seem like they'd return class instances, why a class method?

@josenavas
Copy link
Contributor Author

uhm... I will need to access to some class variables, that is why I decided to make them class methods.

For example, in the DataBase object that I'm writing right now, I'm using class variables to store some table names, and it is useful to abstract some methods. If they're classmethods, I can access the subclass variables. That makes sense? Or am I missing something?

@wasade
Copy link
Contributor

wasade commented May 30, 2014

ah, yes, makes sense

On Fri, May 30, 2014 at 1:01 PM, josenavas notifications@github.com wrote:

uhm... I will need to access to some class variables, that is why I
decided to make them class methods.

For example, in the DataBase object that I'm writing right now, I'm using
class variables to store some table names, and it is useful to abstract
some methods. If they're classmethods, I can access the subclass variables.
That makes sense? Or am I missing something?


Reply to this email directly or view it on GitHub
#64 (comment).

wasade added a commit that referenced this pull request May 30, 2014
@wasade wasade merged commit 8371d7d into qiita-spots:master May 30, 2014
@josenavas
Copy link
Contributor Author

Thanks!

@josenavas josenavas deleted the exists branch June 4, 2014 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants