Skip to content
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

Closed
wants to merge 2 commits into from
Closed

Added More Robust Example #222

wants to merge 2 commits into from

Conversation

askpatrickw
Copy link
Contributor

A little more help for those getting started. This would have saved me some time this week.

A little more help for those getting started. This would have saved me some time this week.
Copy link
Member

@Gagaro Gagaro left a 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.
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

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
------------
Copy link
Member

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.

Copy link
Contributor Author

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?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

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
--------
Copy link
Member

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
@mfrasca
Copy link
Contributor

mfrasca commented Jul 15, 2019

I think it's a pity to have users contributions get outdated on such smallish base, like the number of dashes below a title.

@askpatrickw
Copy link
Contributor Author

yeah.. I gave up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants