Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get field input types working? #60

Open
samjarman opened this issue Jul 16, 2014 · 0 comments
Open

How to get field input types working? #60

samjarman opened this issue Jul 16, 2014 · 0 comments

Comments

@samjarman
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant