Advertisement
MartinYanchev-99

forms.py

Mar 26th, 2021
1,136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.51 KB | None | 0 0
  1. from django.contrib.auth.forms import UserCreationForm
  2. from django.contrib.auth.models import User
  3. from django.forms import ModelForm
  4. from django import forms
  5. from .models import Sleep
  6. from django.contrib.admin.widgets import AdminDateWidget,AdminTimeWidget,AdminSplitDateTime
  7. class AddSleepForm(ModelForm):
  8.     class Meta:
  9.         model = Sleep
  10.         fields = '__all__'
  11.         exclude = ['user']
  12.         widgets = {
  13.             'start':AdminSplitDateTime(),
  14.             'end': AdminSplitDateTime()
  15.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement