예제 #1
0
파일: helpers.py 프로젝트: AALEKH/zamboni
def device_list(product):
    device_types = product.device_types
    if device_types:
        t = env.get_template('detail/helpers/device_list.html')
        return jinja2.Markup(t.render({
            'device_types': device_types,
            'all_device_types': DEVICE_TYPES.values()}))
예제 #2
0
def device_list(product):
    device_types = product.device_types
    if device_types:
        t = env.get_template('detail/helpers/device_list.html')
        return jinja2.Markup(
            t.render({
                'device_types': device_types,
                'all_device_types': DEVICE_TYPES.values()
            }))
예제 #3
0
    def _step(self):
        self.user.update(read_dev_agreement=datetime.datetime.now())
        self.cl = AppSubmissionChecklist.objects.create(addon=self.webapp, terms=True, manifest=True)

        # Associate app with user.
        AddonUser.objects.create(addon=self.webapp, user=self.user)

        # Associate device type with app.
        self.dtype = DEVICE_TYPES.values()[0]
        AddonDeviceType.objects.create(addon=self.webapp, device_type=self.dtype.id)
        self.device_types = [self.dtype]

        # Associate category with app.
        self.cat1 = Category.objects.create(type=amo.ADDON_WEBAPP, name="Fun")
        AddonCategory.objects.create(addon=self.webapp, category=self.cat1)
예제 #4
0
    def _step(self):
        self.user.update(read_dev_agreement=datetime.datetime.now())
        self.cl = AppSubmissionChecklist.objects.create(addon=self.webapp,
            terms=True, manifest=True)

        # Associate app with user.
        AddonUser.objects.create(addon=self.webapp, user=self.user)

        # Associate device type with app.
        self.dtype = DEVICE_TYPES.values()[0]
        AddonDeviceType.objects.create(addon=self.webapp,
                                       device_type=self.dtype.id)

        # Associate category with app.
        self.cat1 = Category.objects.create(type=amo.ADDON_WEBAPP, name='Fun')
        AddonCategory.objects.create(addon=self.webapp, category=self.cat1)
예제 #5
0
    def _step(self):
        #self.user.update(read_dev_agreement=datetime.datetime.now())
        self.user.update(read_dev_agreement=True)
        self.cl = AppSubmissionChecklist.objects.create(addon=self.webapp,
            terms=True, manifest=True)

        # Associate app with user.
        AddonUser.objects.create(addon=self.webapp, user=self.user)

        # Associate device type with app.
        self.dtype = DEVICE_TYPES.values()[0]
        AddonDeviceType.objects.create(addon=self.webapp,
                                       device_type=self.dtype.id)

        # Associate category with app.
        self.cat1 = Category.objects.create(type=amo.ADDON_WEBAPP, name='Fun')
        AddonCategory.objects.create(addon=self.webapp, category=self.cat1)

        # Create initial formset for categories.
        ctx = self.client.get(self.url).context['form_cats']
        self.cat_initial = amo.tests.initial(ctx.initial_forms[0])
예제 #6
0
 def devices(self, data):
     with no_translation():
         names = dict([(n.api_name, n.id)
                       for n in DEVICE_TYPES.values()])
     filtered = [names.get(n, n) for n in data.get('device_types', [])]
     return {'device_types': filtered}
예제 #7
0
 def devices(self, data):
     with no_translation():
         names = dict([(n.api_name, n.id)
                       for n in DEVICE_TYPES.values()])
     filtered = [names.get(n, n) for n in data.get('device_types', [])]
     return {'device_types': filtered}