コード例 #1
0
ファイル: admin.py プロジェクト: clement/django-wurfl
    def update_hybrid_view(self, request):
        updates = update.hybrid()

        if any(map(operator.attrgetter('errors'), updates)):
            message = _('There was some errors when computing the hybrid table, please check the error report')
        else:
            message = _('Hybrid table build successfully')

        request.user.message_set.create(message=message)
        return HttpResponseRedirect(request.path + "../")
コード例 #2
0
ファイル: wurfl-hybrid.py プロジェクト: clement/django-wurfl
    def handle_noargs(self, *args, **options):
        print 'Building hybrid tables from patches and original devices...'
        try:
            updates = update.hybrid()

            for u in updates:
                print '-- %s Update --' % u.get_update_type_display()
                print u.summary
        except Exception, e:
            if options.get('traceback', False):
                import traceback
                traceback.print_exc()
            else:
                raise CommandError(e)
コード例 #3
0
ファイル: admin.py プロジェクト: matinfo/django-wurfl
    def update_hybrid_view(self, request):

        if not self.has_add_permission(request):
            raise PermissionDenied

        updates = update.hybrid()

        if any(map(operator.attrgetter('errors'), updates)):
            message_bit = _('There was some errors when computing the hybrid table, please check the error report')
        else:
            message_bit = _('Hybrid table build successfully')

        self.message_user(request, "%s" % message_bit)
        return HttpResponseRedirect(reverse('admin:wurfl_update_changelist'))