create editor utils.py
This commit is contained in:
parent
713a94e5f6
commit
8958d9e516
5 changed files with 8 additions and 7 deletions
|
@ -8,7 +8,8 @@ from django.db import models
|
|||
from django.db.models import Q
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from c3nav.editor.wrappers import ModelInstanceWrapper, is_created_pk
|
||||
from c3nav.editor.utils import is_created_pk
|
||||
from c3nav.editor.wrappers import ModelInstanceWrapper
|
||||
|
||||
|
||||
class Change(models.Model):
|
||||
|
|
|
@ -12,7 +12,8 @@ from django.utils.translation import ugettext_lazy as _
|
|||
from django.utils.translation import ungettext_lazy
|
||||
|
||||
from c3nav.editor.models.change import Change
|
||||
from c3nav.editor.wrappers import ModelWrapper, is_created_pk
|
||||
from c3nav.editor.utils import is_created_pk
|
||||
from c3nav.editor.wrappers import ModelWrapper
|
||||
from c3nav.mapdata.models import LocationSlug
|
||||
from c3nav.mapdata.models.locations import LocationRedirect
|
||||
|
||||
|
|
2
src/c3nav/editor/utils.py
Normal file
2
src/c3nav/editor/utils.py
Normal file
|
@ -0,0 +1,2 @@
|
|||
def is_created_pk(pk):
|
||||
return isinstance(pk, str) and pk.startswith('c') and pk[1:].isnumeric()
|
|
@ -8,8 +8,8 @@ from django.utils.formats import date_format
|
|||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from c3nav.editor.models import ChangeSet
|
||||
from c3nav.editor.utils import is_created_pk
|
||||
from c3nav.editor.views.base import sidebar_view
|
||||
from c3nav.editor.wrappers import is_created_pk
|
||||
from c3nav.mapdata.models.locations import LocationRedirect, LocationSlug
|
||||
|
||||
|
||||
|
|
|
@ -11,10 +11,7 @@ from django.db.models.query_utils import DeferredAttribute
|
|||
from django.utils.functional import cached_property
|
||||
|
||||
from c3nav.editor.forms import create_editor_form
|
||||
|
||||
|
||||
def is_created_pk(pk):
|
||||
return isinstance(pk, str) and pk.startswith('c') and pk[1:].isnumeric()
|
||||
from c3nav.editor.utils import is_created_pk
|
||||
|
||||
|
||||
class BaseWrapper:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue