I don't clearly know how to name my issue, please read the body.

14 views
Skip to first unread message

vineeth sagar

unread,
Sep 9, 2018, 10:07:06 AM9/9/18
to Django users
I have a form class like this, if the db is not populated I skip that field, in the future when something thaat might trigger a d population happens and I try to render this form, it doesn't recognise the update, but once I restart the development server it renders with the newly added field? Is this how it's supposed to happen?  How Can I overcome this? In production I cant just start/stop the server right?  can anyone help me with this? Thank you

class Schedule(...):

           try:
mails = forms.ModelChoiceField(queryset=FetchFrom.objects.all(),
to_field_name="mail",empty_label=None,initial=FetchFrom.objects.latest("id"))
except Exception as e:
mails=None
Reply all
Reply to author
Forward
0 new messages