drought/dashboard/form.py

44 lines
1.7 KiB
Python

from django.forms import forms
from dashboard.models import Country, Spi, Hydro, Landuse, Finance, Popu
class CountryForm(forms.Model):
class Meta:
model = Country
fields = ['name', 'parent_name', 'level', 'datetime', 'area', 'arable_land_area', 'population',
'agricultural_population', 'gross_national_product', 'total_agricultural_output',
'arable_land_per_capita']
class SpiForm(forms.Model):
class Meta:
model = Spi
fields = ['code', 'longitude', 'latitude', 'year', 'month', 'mean_precipitation', 'mean_temperature']
class HydroForm(forms.Model):
class Meta:
model = Hydro
fields = ['name', 'date', 'average_water_level', 'average_flow_rate', 'precipitation']
class LanduseForm(forms.Model):
class Meta:
model = Landuse
fields = ['name', 'date', 'Cultivated_land_area', 'Irrigated_land', 'eatch_land', 'eatch_Irrigated_land']
class FinanceForm(forms.Model):
class Meta:
model = Finance
fields = ['region', 'level', 'date', 'financial_revenue', 'tax_revenue', 'value_added_tax', 'sales_tax',
'corporate_income_tax', 'individual_income_tax', 'resource_tax', 'urban_maintenance_construction_tax',
'property_tax', 'stamp_duty', 'urban_land_use_tax', 'land_value_added_tax', 'vehicle_vessel_tax',
'arable_land_occupancy_tax', 'deed_tax', 'tobacco_tax', 'non_tax_revenue']
class PopuForm(forms.Model):
class Meta:
model = Popu
fields = ['region', 'date', 'permanent_population', 'households', 'census_register_population', 'male', 'female_sex','birth_rate','mortality','growth_rate','urbanization_rate']