Hi,
I'm currently trying to implement a map within a form using class based model.
The map does not show on the page/form. The map, however, shows on the admin page
and stores the location successfully.
Any thoughts on where is the problem?
Model
from django.contrib.gis.db import models
class Property(models.Model):
....
location = models.PointField()
....
View
class PropertyCreate(CreateView):
form_class = PropertyForm
model = Property
.....
Forms
class PropertyForm(forms.ModelForm):
location = forms.PointField(widget=
forms.OSMWidget(attrs={'map_width': 800, 'map_height': 500}))
class Meta:
model = Property
Template
<form action="" method="post">
<div class="row">
<div class="col-md-8"> {{form.location }}</div>
</div>