python - Django Form Not updating -


i'm trying update form in django. have following:

models.py

from django.db import models django.core.urlresolvers import reverse  class list(models.model):     def get_absolute_url(self):         return reverse('view_list', args=[self.id])  # create models here. class item(models.model):     text = models.textfield(default = '')     list = models.foreignkey(list, default = none) 

forms.py

from django import forms  lists.models import item  empty_item_error = "you can't have empty list item" class itemform(forms.models.modelform):     class meta:         model = item         fields = ('text',)         widgets ={             'text' : forms.fields.textinput(attrs={                     'placeholder': 'enter to-do item',                     'class': 'form-control input-lg',             }),         }         error_messages = {             'text' : { 'required': empty_item_error }         } 

i'm not seeing changes in forms.py has been loaded. mean is, page displays form find, if attempt change, example, placeholder value::

            'placeholder': 'enter to-do item or don't!', 

the input box doesn't show changes once page loads. there manage.py command need run? or other migration?

i'm assuming saying don't see changes in browser. suggest clear browser's cache , reload page. if go manage section of browser developer tools , select option not store cache when dev tools activated. cache can pain when forget exists.

answering question @ bottom: don't need reload manage.py runserver or use command. django automatically reloads server (the simple 1 used in development) every change in python files.


Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -