We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
hi how can create a Custom Forms ? i read the doc but can't figure out how is that works! my forms :
class MyMapWidget(LeafletWidget): geometry_field_class = 'locationofuser' class NewreportForm(forms.ModelForm): class Meta: model = Reports fields = ('name', 'locationofuser', ) widgets = {'locationofuser': MyMapWidget(), }
template :
<div class="col-md-12 mb-3"> <h6 class="card-header text-right bg-dark text-light">location</h6> {{ form.locationofuser }} <script type="text/javascript"> locationofuser = L.GeometryField.extend({ addTo: function (map) { L.GeometryField.prototype.addTo.call(this, map); // start L.geoJSON(json__2, { style: function (feature) { return feature.properties && feature.properties.style; }, onEachFeature: onEachFeature, pointToLayer: function (feature, latlng) { return L.circleMarker(latlng, { radius: 8, fillColor: "#ff7800", color: "#000", weight: 1, opacity: 1, fillOpacity: 0.8 }); } }).addTo(map); var filecontrol = map.filecontrol = L.Control.fileLayerLoad(); map.addControl(filecontrol); } }); </script>
The text was updated successfully, but these errors were encountered:
Try adding the form media:
{{ form.media }}
CF https://docs.djangoproject.com/en/3.0/topics/forms/media/#media-on-forms
Sorry, something went wrong.
No branches or pull requests
hi
how can create a Custom Forms ? i read the doc but can't figure out how is that works!
my forms :
template :
The text was updated successfully, but these errors were encountered: