This repository has been archived by the owner on Apr 22, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add autodiscover to models: lazy import methods from sequere in Seque…
…reMixin
- Loading branch information
Showing
4 changed files
with
31 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
version = (0, 1, 1) | ||
version = (0, 1, 2) | ||
|
||
__version__ = '.'.join(map(str, version)) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,45 @@ | ||
from . import models as sequere | ||
|
||
|
||
class SequereMixin(object): | ||
def follow(self, instance): | ||
return sequere.follow(self, instance) | ||
from .models import follow | ||
|
||
return follow(self, instance) | ||
|
||
def is_following(self, instance): | ||
return sequere.is_following(self, instance) | ||
from .models import is_following | ||
|
||
return is_following(self, instance) | ||
|
||
def unfollow(self, instance): | ||
return sequere.unfollow(self, instance) | ||
from .models import unfollow | ||
|
||
return unfollow(self, instance) | ||
|
||
def get_followings(self, *args, **kwargs): | ||
return sequere.get_followings(self, *args, **kwargs) | ||
from .models import get_followings | ||
|
||
return get_followings(self, *args, **kwargs) | ||
|
||
def get_followings_count(self, *args, **kwargs): | ||
return sequere.get_followings_count(self, *args, **kwargs) | ||
from .models import get_followings_count | ||
|
||
return get_followings_count(self, *args, **kwargs) | ||
|
||
def get_followers_count(self, *args, **kwargs): | ||
return sequere.get_followers_count(self, *args, **kwargs) | ||
from .models import get_followers_count | ||
|
||
return get_followers_count(self, *args, **kwargs) | ||
|
||
def get_friends_count(self, *args, **kwargs): | ||
return sequere.get_friends_count(self, *args, **kwargs) | ||
from .models import get_friends_count | ||
|
||
return get_friends_count(self, *args, **kwargs) | ||
|
||
def get_friends(self, *args, **kwargs): | ||
return sequere.get_friends(self, *args, **kwargs) | ||
from .models import get_friends | ||
|
||
return get_friends(self, *args, **kwargs) | ||
|
||
def get_followers(self, *args, **kwargs): | ||
return sequere.get_followers(self, *args, **kwargs) | ||
from .models import get_followers | ||
|
||
return get_followers(self, *args, **kwargs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters