towards supporting python 2 and 3

- use absolute_imports
- make use of six.moves
- use exec instead of execfile
- use list(dict) instead if dict.keys()
This commit is contained in:
j 2016-08-23 12:27:06 +02:00
commit 1468ddbecb
89 changed files with 400 additions and 265 deletions

View file

@ -1,9 +1,10 @@
# -*- coding: utf-8 -*-
# vi:si:et:sw=4:sts=4:ts=4
from __future__ import division, print_function, absolute_import
from django.contrib import admin
import models
from . import models
class NewsAdmin(admin.ModelAdmin):

View file

@ -1,11 +1,11 @@
# -*- coding: utf-8 -*-
# vi:si:et:sw=4:sts=4:ts=4
from __future__ import division, with_statement
from __future__ import division, print_function, absolute_import
from django.db import models
import ox
import managers
from . import managers
class News(models.Model):
@ -35,7 +35,7 @@ class News(models.Model):
'text': self.text,
}
if keys:
for key in j.keys():
for key in list(j):
if key not in keys:
del j[key]
return j

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# vi:si:et:sw=4:sts=4:ts=4
from __future__ import division
from __future__ import division, print_function, absolute_import
import ox
from ox.utils import json
@ -11,7 +11,7 @@ from oxdjango.shortcuts import render_to_json_response, get_object_or_404_json,
from oxdjango.api import actions
from changelog.models import add_changelog
import models
from . import models
def getNews(request, data):
'''