Задать вопрос

Тел: +7 965 3737 888

581

Просмотров

5

Ответов

adding fields to User model

This code adds new field to Django user model. It must be executed early as much as possible, so put this code to init.py of some application.

Вопрос полезен? Да0/Нет0
file_3948.py(173.0б)
None

Ответы (5):

Ответntechrajan:01.12.2014
Ответ полезен? Да0/Нет0

how to retrive this added fields list from model? when i retrive fields using user._meta.get_all_field_names() method i only get default fields, i don't get newly added fields...

Ответdnuske:04.11.2010
Ответ полезен? Да0/Нет0

Hi, while this worked fine for adding a new field, I would like to go forward and know how to make this new field appear in the admin section.

If somebody give me an approach I'll be thankful! =)

Ответudfalkso:17.08.2010
Ответ полезен? Да0/Нет0

I'm trying this out. So far so good...

Ответdiverman:03.08.2010
Ответ полезен? Да0/Нет0

sberlotto:

manage.py sqlall and manage.py syncdb creates new column properly.

What is your problem? If your column doesn't exist aleready, write an ALTER TABLE command.

I don't understand the negative score, since this snippet is working well.

Ответsberlotto:03.08.2010
Ответ полезен? Да0/Нет0

How to Sync this modified model with my database ?