Пример #1
0
def trigger(category,action,user,**vars):
    """
    Triggers Axilent.
    """
    profile = AxilentProfile.objects.profile(user)
    client = utils.client('axilent.triggers')
    client.trigger(data={'profile':profile.profile,
                         'category':category,
                         'action':action,
                         'variables':vars})
Пример #2
0
"""
Loads content from Axilent, syncing local models according to thier content mappings.
"""
from django.core.management.base import BaseCommand, CommandError
from django.conf import settings
from axilent.registry import get_content_mappings
from axilent import utils
from axilent.models import ContentBinding
from django.template.defaultfilters import slugify

resource = utils.resource('axilent.content','content')
client = utils.client('axilent.content')


class Command(BaseCommand):
    """
    Command class.
    """
    
    def handle(self,*args,**kwargs):
        """
        Handler method.
        """
        if len(args):
            self.sync_app(args[0])
        else:
            # sync all the apps
            for app_path in settings.INSTALLED_APPS:
                if app_path != 'axilent' and not app_path.startswith('django'): # don't sync yourself or django contrib apps
                    self.sync_app(app_path)
            
Пример #3
0
 def __init__(self,channel_name):
     """
     Constructor.
     """
     self.slug = slugify(channel_name)
     self.client = utils.client('axilent.content')
Пример #4
0
"""
Loads content from Axilent, syncing local models according to thier content mappings.
"""
from django.core.management.base import BaseCommand, CommandError
from django.conf import settings
from axilent.registry import get_content_mappings
from axilent import utils
from axilent.models import ContentBinding
from django.template.defaultfilters import slugify

resource = utils.resource('axilent.content', 'content')
client = utils.client('axilent.content')


class Command(BaseCommand):
    """
    Command class.
    """
    def handle(self, *args, **kwargs):
        """
        Handler method.
        """
        if len(args):
            self.sync_app(args[0])
        else:
            # sync all the apps
            for app_path in settings.INSTALLED_APPS:
                if app_path != 'axilent' and not app_path.startswith(
                        'django'
                ):  # don't sync yourself or django contrib apps
                    self.sync_app(app_path)