New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added More Robust Example #222
Conversation
A little more help for those getting started. This would have saved me some time this week.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
Thanks a lot for your PR 👍 . If you could just fix the title and answer me for the comment, I'm not sure to understand what you wanted to mean, that would be great.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't you mean the other way around? register is required for the TabularInline
but is for the LeafletGeoAdmin
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. I tested this. The decorator is required for the inline only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then there is something I don't understand with what you wrote. The LeafletGeoAdmin
is correctly decorated but does it have to do with the inlines?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Decorator is not required for django-leaflet, but if you have an inline it is required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be required with or without inline (or admin.site.register
).
docs/widget.rst
Outdated
@@ -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 | |||
------------ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please match the number of -
under the title.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I don't understand and don't know RST. Are you saying the "-" line should be the same length and the line above it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it doesn't really matter, as long as it's equal or more. it works this way too.
docs/widget.rst
Outdated
@@ -33,7 +47,7 @@ A mixin is also available for inline forms: | |||
model = PoiLocation | |||
|
|||
|
|||
In forms | |||
In forms.py | |||
-------- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please match the number of -
under the title.
fixed section underline
I think it's a pity to have users contributions get outdated on such smallish base, like the number of dashes below a title. |
yeah.. I gave up. |
A little more help for those getting started. This would have saved me some time this week.