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
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/8cd9ab46-ef1b-479a-8843-950ceb6820cd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.