Monday, September 15, 2014

Re: Django Modeling setting an integer value to a negative value

Dam, on top of that I marked the fields as editable=False and it wasn't working as expected.  I was able to change the value from 1 to 2 using the Admin.  Why isn't this working?


I read here that it should work, https://docs.djangoproject.com/en/1.7/ref/models/fields/#editable

editable

If False, the field will not be displayed in the admin or any other ModelForm. They are also skipped during model validation. Default is True.





On Mon, Sep 15, 2014 at 6:09 PM, Michael Martin <mikemartin221@gmail.com> wrote:
Is it possible to default a integer to a negative number with Django Modeling?

I did the following, but the value in the display shows 1 not -1


ces_out_servicegrid_polling_interval=models.IntegerField(default=-1, editable=False)

--
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 django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAD0urK0aAPwnwhmt-4bTUT%3D5Jj_O04v02OzorBL3eucGRhV4gw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment