Skip to content

Instantly share code, notes, and snippets.

@jeremyjbowers
Created May 28, 2014 02:06
Show Gist options
  • Save jeremyjbowers/5493a4b35dc7e549128f to your computer and use it in GitHub Desktop.
Save jeremyjbowers/5493a4b35dc7e549128f to your computer and use it in GitHub Desktop.
from django.contrib import admin
from housing.models import HouseInformation, InspectionReport
class HouseInformationAdmin(admin.ModelAdmin):
fieldsets = (
(None, {
'fields': ('house_name', 'house_type')
}),
('Location', {
'fields': ('address', 'longitude', 'latitude')
}),
)
inlines = [
InspectionReportInline
]
class InspectionReportInline(admin.TabularInline):
model = InspectionReport
class InspectionReportAdmin(admin.ModelAdmin):
inlines = [
InspectionReportInline
]
admin.site.register(HouseInformation, HouseInformationAdmin)
admin.site.register(InspectionReport)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment