コード例 #1
0
def profile_changed(sender, instance, **kwargs):
    # import 写在函数里面避免循环依赖
    from accounts.services import UserService
    # note: it's user_id instead of id
    UserService.invalidate_profile(instance.user_id)
コード例 #2
0
def profile_changed(sender, instance, **kwargs):
    # import inside a function to prevent cycling dependence
    from accounts.services import UserService
    UserService.invalidate_profile(instance.user_id)
コード例 #3
0
ファイル: listeners.py プロジェクト: linr1/django-twitter
def profile_changed(sender, instance, **kwargs):
    from accounts.services import UserService
    UserService.invalidate_profile(instance.user_id)
コード例 #4
0
def profile_changed(sender, instance, **kwargs):
    # import only in function to avoid cyclic dependencies
    from accounts.services import UserService
    UserService.invalidate_profile(instance.user_id)
コード例 #5
0
def profile_changed(sender, instance, **kwargs):
    # import avoid circular dependency
    from accounts.services import UserService
    UserService.invalidate_profile(instance.user_id)