Also this page, http://code.djangoproject.com/changeset/5202 , says
that

>> If you specify ``fields`` when creating a form with ``form_for_model()``
>>       make sure that the fields that are *not* specified can provide default
>>       values, or are allowed to have a value of ``None``

So providing default values for models should be possible.

On Jun 18, 9:30 pm, shabda <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have a model class like this
>
> class Link(models.Model):
>     link = models.URLField()
>     user = models.ForeignKey(User, unique=False)
>     text = models.TextField(maxlength = 20)
>     votes = models.IntegerField()
>
> I want some of the fields to have defaults, like I want votes to have
> a default value of 0. How can I achieve this. I dont seem to find any
> documentation for this, but seems to common a case to not be possible.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to