mirror of
https://github.com/adrigongv23/G26---Telemetry-Software.git
synced 2026-08-25 19:43:16 +02:00
Sección de contabilida añadida
This commit is contained in:
parent
408d4d006e
commit
a15f836e07
7 changed files with 430 additions and 9 deletions
24
Plataform_Web/gestion/forms.py
Normal file
24
Plataform_Web/gestion/forms.py
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
from django import forms
|
||||
from .models import Gasto, Ingreso
|
||||
|
||||
|
||||
class GastoForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = Gasto
|
||||
fields = ['concepto', 'importe', 'categoria', 'observaciones']
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
for field in self.fields.values():
|
||||
field.widget.attrs['class'] = 'form-control'
|
||||
|
||||
|
||||
class IngresoForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = Ingreso
|
||||
fields = ['concepto', 'importe', 'categoria', 'observaciones']
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
for field in self.fields.values():
|
||||
field.widget.attrs['class'] = 'form-control'
|
||||
Loading…
Add table
Add a link
Reference in a new issue