catalog editor: load catalog, region, season data
This commit is contained in:
@ -11,12 +11,26 @@ class Season(models.Model):
|
||||
name = models.CharField(max_length=100)
|
||||
ordering = models.PositiveIntegerField(unique=True, default=1000)
|
||||
|
||||
def serialize(self):
|
||||
return {
|
||||
'id': self.id,
|
||||
'name': self.name,
|
||||
'ordering': self.ordering,
|
||||
}
|
||||
|
||||
|
||||
class Region(models.Model):
|
||||
id = models.CharField(max_length=30, primary_key=True)
|
||||
name = models.CharField(max_length=100)
|
||||
ordering = models.PositiveIntegerField(unique=True, default=1000)
|
||||
|
||||
def serialize(self):
|
||||
return {
|
||||
'id': self.id,
|
||||
'name': self.name,
|
||||
'ordering': self.ordering,
|
||||
}
|
||||
|
||||
|
||||
def pretty_datetime(date):
|
||||
# Oct 16 2018 10:58 am
|
||||
|
||||
@ -21,7 +21,7 @@ from lazysignup.views import convert
|
||||
|
||||
from dashboard.views import dashboard
|
||||
from cataloglist.views import cataloglist, my_catalogs, public_catalogs
|
||||
from catalogedit.views import catalogedit
|
||||
from catalogedit.views import catalogedit, get_catalog
|
||||
|
||||
from .forms import UserCreationForm
|
||||
from .views import login_guest, lazy_convert_done
|
||||
@ -36,7 +36,9 @@ urlpatterns = [
|
||||
path('api/v1/catalogs/mine', my_catalogs, name='my_catalogs'),
|
||||
path('api/v1/catalogs/public', public_catalogs, name='public_catalogs'),
|
||||
|
||||
path('edit', catalogedit, name='catalogedit'),
|
||||
path('catalog/new', catalogedit, name='catalogedit'),
|
||||
path('catalog/edit/<int:id>', catalogedit, name='catalogedit'),
|
||||
path('api/v1/catalogs/id/<int:id>', get_catalog, name='catalog'),
|
||||
|
||||
path('admin/', admin.site.urls),
|
||||
path("account/", include("account.urls")),
|
||||
|
||||
Reference in New Issue
Block a user