22 lines
595 B
Python
22 lines
595 B
Python
# -*- coding: utf-8 -*-
|
|
from django import forms
|
|
|
|
from apps.geoproc.models.model_obstation import ObStation
|
|
from apps.geoproc.models.model_point import Point
|
|
|
|
|
|
class PointForm(forms.ModelForm):
|
|
name = forms.CharField(
|
|
widget=forms.TextInput(attrs={"class": "form-control", "autofocus": ""})
|
|
)
|
|
obstation = forms.ModelChoiceField(
|
|
queryset=ObStation.objects.all(),
|
|
widget=forms.Select(
|
|
attrs={"class": "form-control select2", "id": "id_obstation"}
|
|
),
|
|
)
|
|
|
|
class Meta:
|
|
model = Point
|
|
fields = ("id", "name", "obstation")
|