admin config show added tables

This commit is contained in:
Johnson Chetty 2011-12-23 13:19:17 +05:30
parent 913fbef643
commit f9292b28a5
2 changed files with 35 additions and 5 deletions

Binary file not shown.

View File

@ -5,16 +5,27 @@ from mumbai.models import *
class AreaAdmin(admin.ModelAdmin): class AreaAdmin(admin.ModelAdmin):
list_display = ("a_code", "areanm") list_display = ("a_code", "areanm")
list_editable = ("areanm",) list_editable = ("areanm",)
formfield_overrides = {
models.TextField: {'widget': forms.TextInput},
}
class RoadAdmin(admin.ModelAdmin): class RoadAdmin(admin.ModelAdmin):
list_display = ("roadcd","roadnm") list_display = ("roadcd","roadnm")
list_editable = ("roadnm",) list_editable = ("roadnm",)
formfield_overrides = {
models.TextField: {'widget': forms.TextInput},
}
class FareAdmin(admin.ModelAdmin): class FareAdmin(admin.ModelAdmin):
list_display = ("slab","ordinary","limited","express","ac","ac_express") list_display = ("slab","ordinary","limited","express","ac","ac_express")
list_editable = ("ordinary","limited","express","ac","ac_express") list_editable = ("ordinary","limited","express","ac","ac_express")
formfield_overrides = {
models.TextField: {'widget': forms.TextInput},
}
class StopForm(forms.ModelForm): class StopForm(forms.ModelForm):
@ -26,7 +37,8 @@ class StopAdmin(admin.ModelAdmin):
list_display = ("stopcd","stopnm", "roadcd","a_code","stopfl","depot","chowki") list_display = ("stopcd","stopnm", "roadcd","a_code","stopfl","depot","chowki")
list_editable = ("stopnm", "roadcd","a_code","stopfl","depot","chowki") list_editable = ("stopnm", "roadcd","a_code","stopfl","depot","chowki")
search_fields = ("stopcd",'stopnm', 'depot') search_fields = ("stopcd",'stopnm', 'depot')
ordering = ('-stopnm',) ordering = ('stopnm',)
list_per_page = 50
fieldsets = ( fieldsets = (
(None, { (None, {
@ -59,9 +71,23 @@ class RouteTypesAdmin(admin.ModelAdmin):
class HardCodedRoutesAdmin(admin.ModelAdmin): class HardCodedRoutesAdmin(admin.ModelAdmin):
list_display = ("routecode","routealias","faretype") list_display = ("routecode","routealias","faretype")
class AreaAdmin(admin.ModelAdmin): class LandmarkAdmin(admin.ModelAdmin):
list_display = ("a_code", "areanm") list_display = ("name", "name_mr")
list_editable = ("areanm",) list_editable = ("name_mr",)
class StopLocationAdmin(admin.ModelAdmin):
list_display = ("stop", "direction")
#list_editable = ("name","name_mr")
class DepotAdmin(admin.ModelAdmin):
list_display = ("depot_code", "depot_name", "stop")
list_editable = ("depot_name",)
class HolidayAdmin(admin.ModelAdmin):
list_display = ("h_date", "h_name")
list_editable = ("h_name",)
admin.site.register(Area, AreaAdmin) admin.site.register(Area, AreaAdmin)
@ -75,3 +101,7 @@ admin.site.register(Route, RouteAdmin)
admin.site.register(RouteTypes, RouteTypesAdmin) admin.site.register(RouteTypes, RouteTypesAdmin)
admin.site.register(HardCodedRoutes, HardCodedRoutesAdmin) admin.site.register(HardCodedRoutes, HardCodedRoutesAdmin)
admin.site.register(Landmark, LandmarkAdmin )
admin.site.register(Depot,DepotAdmin)
admin.site.register(Holiday,HolidayAdmin)
admin.site.register(StopLocation,StopLocationAdmin)