Add admin alvincent in app Calendar and Add data

parent 02dce727
from django.contrib import admin from django.contrib import admin
from .models import Location, Event
# Register your models here.
class LocationAdmin(admin.ModelAdmin):
model = Location
class EventAdmin(admin.ModelAdmin):
model = Event
admin.site.register(Location, LocationAdmin)
admin.site.register(Event, EventAdmin)
from django.db import models from django.db import models
MODE_TYPES = (
('onsite', 'Onsite'),
('online', 'Online'),
('hybrid', 'Hybrid'),
)
class Location(models.Model): class Location(models.Model):
MODE_TYPES = (
('onsite', 'Onsite'),
('online', 'Online'),
('hybrid', 'Hybrid'),
)
mode = models.CharField(max_length=6, choices=MODE_TYPES) mode = models.CharField(max_length=6, choices=MODE_TYPES)
venue = models.CharField(max_length=100) venue = models.CharField(max_length=100)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment