Added Project.find_by_url(project_url) because it's so commonly used as ID
This commit is contained in:
@@ -39,6 +39,14 @@ class Project(List, Find, Create, Post, Update, Delete, Replace):
|
||||
else:
|
||||
raise ResourceNotFound(response)
|
||||
|
||||
@classmethod
|
||||
def find_by_url(cls, project_url, params=None, api=None):
|
||||
if params is None:
|
||||
params = {}
|
||||
params.setdefault('where', {}).setdefault('url', project_url)
|
||||
|
||||
return cls.find_one(params, api=api)
|
||||
|
||||
def update(self, attributes=None, api=None):
|
||||
api = api or self.api
|
||||
attributes = attributes or self.to_dict()
|
||||
|
||||
Reference in New Issue
Block a user