Skip to content

Commit

Permalink
Merge 177a464 into 059f171
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick committed Jul 13, 2018
2 parents 059f171 + 177a464 commit c68917f
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions docs/widget.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ It embeds *Leaflet.draw* in version *0.4.0*.
.. image :: https://f.cloud.github.com/assets/546692/1048836/78b6ad94-1094-11e3-86d8-c3e88626a31d.png
In Adminsite
In admin.py
------------

::
Expand All @@ -17,10 +17,24 @@ In Adminsite
from leaflet.admin import LeafletGeoAdmin

from .models import WeatherStation
from .models import WeatherSensor


# A Basic Example
admin.site.register(WeatherStation, LeafletGeoAdmin)

"""A More Complicated Example
Notice ModelAdmin(admin.ModelAdmin) also has to change to modelAdmin(LeafletGeoAdmin)
@admin.register() decorator not required for Django-Leaflet, but is for inlines.
"""
class WeatherSensorInline(admin.TabularInline):
model = WeatherSensor
fields = ['manufacturer, 'model', 'sensor_type']
@admin.register(WeatherSensor)
class WeatherSensorAdmin(LeafletGeoAdmin)
model = WeatherSensor
inlines = [WeatherSensorInline,]


A mixin is also available for inline forms:

Expand All @@ -33,7 +47,7 @@ A mixin is also available for inline forms:
model = PoiLocation


In forms
In forms.py
--------

With *Django* >= 1.6:
Expand Down

0 comments on commit c68917f

Please sign in to comment.