forms.py 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. from django import forms
  2. from .models import *
  3. class PSearch_form(forms.Form):
  4. PSearch = forms.CharField(label='Recherche', max_length=128)
  5. class Edit_srv_form(forms.ModelForm):
  6. class Meta:
  7. model = PIS
  8. exclude = ['PIC_NUnic']
  9. widgets = {
  10. 'PIS_Fonctionnalite': forms.Textarea(attrs={'cols': 90, 'rows': 3}),
  11. 'PIS_Commentaires': forms.Textarea(attrs={'cols': 90, 'rows': 3}),
  12. }
  13. class Edit_switch_form(forms.ModelForm):
  14. class Meta:
  15. model = Swich
  16. exclude = ['SW_Update_Port']
  17. widgets = {
  18. 'SW_Commentaires': forms.Textarea(attrs={'cols': 90, 'rows': 2}),
  19. }
  20. class Update_switch_port(forms.ModelForm):
  21. class Meta:
  22. model = Swich
  23. fields = ['SW_Update_Port']
  24. widgets = {
  25. 'SW_Update_Port': forms.Textarea(attrs={'cols': 90, 'rows': 20}),
  26. }
  27. class Edit_switch_port_form(forms.ModelForm):
  28. class Meta:
  29. model = Port_Link
  30. exclude = ['PL_Port']
  31. widgets = {
  32. 'PL_Commentaires': forms.Textarea(attrs={'cols': 90, 'rows': 2}),
  33. }
  34. class Edit_user_mini_form(forms.ModelForm):
  35. class Meta:
  36. model = PIC
  37. fields = ['PIC_Site', 'PIC_Service', 'PIC_L_Chassi_Type', 'PIC_Nom_netbios', 'PIC_Utilisateur', 'PIC_Adresse_IP', 'PIC_Adresse_Mac', 'PIC_SN', 'PIC_Local', 'PIC_Precisions', 'PIC_Commentaires']
  38. widgets = {
  39. 'PIC_Precisions': forms.Textarea(attrs={'cols': 90, 'rows': 1}),
  40. 'PIC_Commentaires': forms.Textarea(attrs={'cols': 90, 'rows': 3}),
  41. }
  42. labels = {
  43. 'PIC_Service': 'Service',
  44. }
  45. class Edit_imp_form(forms.ModelForm):
  46. class Meta:
  47. model = PIC
  48. fields = ['PIC_Site', 'PIC_Service', 'PIC_L_Chassi_Type', 'PIC_Nom_netbios', 'PIC_Utilisateur', 'PIC_Adresse_IP', 'PIC_Marque', 'PIC_Type', 'PIC_SN', 'PIC_Precisions', 'PIC_Local' , 'PIC_Commentaires']
  49. widgets = {
  50. 'PIC_Precisions': forms.Textarea(attrs={'cols': 90, 'rows': 1}),
  51. 'PIC_Commentaires': forms.Textarea(attrs={'cols': 90, 'rows': 3}),
  52. }
  53. labels = {
  54. 'PIC_Service': 'Service',
  55. }
  56. class Edit_user_statut_form(forms.ModelForm):
  57. class Meta:
  58. model = PIC
  59. fields = ['PIC_L_Statut', 'PIC_Accessory', 'PIC_Deg', 'PIC_is_for_Cadre', 'PIC_with_Office']
  60. widgets = {}