reading-notes

This Repo required for Asac labs class 2


Project maintained by ManarAbdelkarim Hosted on GitHub Pages — Theme by mattgraham

Django CRUD and Forms

What is Forms:

submit :

The submit input will be displayed as a button (by default) that can be pressed by the user to upload the data in all the other input elements in the form to the server The form attributes define the HTTP method used to send the data and the destination of the data on the server

(action):

creating a form using Django:

  1. Declaring a Form:

    from django import forms

    class RenewBookForm(forms.Form): renewal_date = forms.DateField(help_text=”Enter a date between now and 4 weeks (default 3).”)

  2. Form fields

BooleanField, CharField, ChoiceField, TypedChoiceField, DateField, DateTimeField, DecimalField, DurationField, EmailField, FileField, FilePathField, FloatField, ImageField, IntegerField, GenericIPAddressField, MultipleChoiceField, TypedMultipleChoiceField, NullBooleanField, RegexField, SlugField, TimeField, URLField, UUIDField, ComboField, MultiValueField, SplitDateTimeField, ModelMultipleChoiceField, ModelChoiceField.

The arguments that are common to most fields: