Hi
How do I get field types to work? So far I cant get the html5 date type to work.
Here is my code:
-- listingform.py ---
from django.db import models
from django.forms import ModelForm
from listings.models import Listing
class ListingForm(ModelForm):
class Meta:
model = Listing
fields = ['title', 'description', 'reward', 'contact', 'duration','conditions', 'expires', 'published']
- (this is all of it)
- expires is a DateField
---Models.py---
eg expires = models.DateField('date expires')
...others...
but the renderer doesn't seem to be picking up on that?
-- views.py --
def researchers(request):
form = ListingForm()
return render(request, 'listings/list.html', {'form': form })
Please help? Do I need to do more in the html file? currently just `{{ form|bootrap}}
Do I need to do more in the form class?
Hi
How do I get field types to work? So far I cant get the html5 date type to work.
Here is my code:
-- listingform.py ---
from django.db import modelsfrom django.forms import ModelFormfrom listings.models import Listingclass ListingForm(ModelForm):class Meta:model = Listingfields = ['title', 'description', 'reward', 'contact', 'duration','conditions', 'expires', 'published']---Models.py---
eg
expires = models.DateField('date expires')...others...but the renderer doesn't seem to be picking up on that?
-- views.py --
def researchers(request):form = ListingForm()return render(request, 'listings/list.html', {'form': form })Please help? Do I need to do more in the html file? currently just `{{ form|bootrap}}
Do I need to do more in the form class?