コード例 #1
0
def update_stats(sender, **kwargs):
    from migration_functions import populate_collection_stats, populate_partner_stats
    instance = kwargs["instance"]
    collection = get_model(
        'social_website', 'Collection').objects.get(uid=instance.collection_id)
    populate_collection_stats(collection)
    populate_partner_stats(collection.partner)
コード例 #2
0
ファイル: post_save_funcs.py プロジェクト: xuan6/dg
def update_stats(sender, **kwargs):
    from migration_functions import populate_collection_stats, populate_partner_stats
    instance = kwargs["instance"]
    try:
        collection = get_model('social_website', 'Collection').objects.get(uid=instance.collection_id)
        populate_collection_stats(collection)
        populate_partner_stats(collection.partner)
    except get_model('social_website', 'Collection').DoesNotExist :
        pass #Collection is deleted no need to update the stats
コード例 #3
0
def update_stats(sender, **kwargs):
    from migration_functions import populate_collection_stats, populate_partner_stats
    instance = kwargs["instance"]
    try:
        collection = get_model(
            'social_website',
            'Collection').objects.get(uid=instance.collection_id)
        populate_collection_stats(collection)
        populate_partner_stats(collection.partner)
    except get_model('social_website', 'Collection').DoesNotExist:
        pass  #Collection is deleted no need to update the stats
コード例 #4
0
ファイル: post_save_funcs.py プロジェクト: raviprakashgiri/dg
def update_stats(sender, **kwargs):
    from migration_functions import populate_collection_stats, populate_partner_stats
    instance = kwargs["instance"]
    collection = get_model('social_website', 'Collection').objects.get(uid=instance.collection_id)
    populate_collection_stats(collection)
    populate_partner_stats(collection.partner)