Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.

#1 Nov. 23, 2005 18:29:09

Grigory F.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

raw_id_admin


Hello!

In model i use this field:

class Article(meta.Model):
author = meta.ForeignKey(User, raw_id_admin=True)

vews/articles.py generate form:

<p><label for="id_author">Author:</label> {{ form.author }}
{% if form.author.errors %}*** {{ form.author.errors|join:", " }}
{% endif % }</p>

If the field is filled by username, form give an error. If it filled
user_id form works correct. How to make form that can be filled by
username insted of user_id?

--
Всего наилучшего!
greg anastasia ru Григорий.

Offline

#2 Nov. 23, 2005 21:21:45

Adrian H.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

raw_id_admin


On 11/23/05, Grigory Fateyev <> wrote:
> class Article(meta.Model):
> author = meta.ForeignKey(User, raw_id_admin=True)
>
> vews/articles.py generate form:
>
> <p><label for="id_author">Author:</label> {{ form.author }}
> {% if form.author.errors %}*** {{ form.author.errors|join:", " }}
> {% endif % }</p>
>
> If the field is filled by username, form give an error. If it filled
> user_id form works correct. How to make form that can be filled by
> username insted of user_id?

Hi Grigory,

raw_id_admin supports only entry of IDs (primary key fields).

Adrian

--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org

Offline

Board footer

Moderator control

Enjoy the 23rd of April
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support