Skip to content

Instantly share code, notes, and snippets.

@fritzvd
Created December 8, 2011 12:51
Show Gist options
  • Save fritzvd/1446911 to your computer and use it in GitHub Desktop.
Save fritzvd/1446911 to your computer and use it in GitHub Desktop.
example inline
from waterqmap.maps.models import Map,MapDate
from django.contrib import admin
class MapDateInline(admin.TabularInline):
#this is the foreignkey
model = MapDate
class MapAdmin(admin.ModelAdmin):
prepopulated_field = {"slug": ("title",)}
inlines = [MapDateInline]
admin.site.register(Map, MapAdmin)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment