Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.

#1 Nov. 29, 2005 11:00:14

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

replaces_module


Hello!

I have forum on phpbb (about 20000 users), and now want to integrate
auth with django. Went throgh legasy database doc and have this table:

class User(users.User):
user_id = meta.IntegerField()
user_active = meta.CharField(maxlength=1)
username = meta.CharField(maxlength=25)
user_password = meta.CharField(maxlength=32)
user_session_time = meta.IntegerField()
user_session_page = meta.IntegerField()
user_lastvisit = meta.IntegerField()
user_regdate = meta.IntegerField()
user_level = meta.CharField(maxlength=4)
user_posts = meta.IntegerField()

class META:
db_table = 'anastas_users'
replaces_module = 'auth.users'
admin = meta.Admin()

as you see, lots of fields have the same fields from auth.users table.
How to escape double of fields, and auth can work like in forum and in
django?

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

Offline

#2 Nov. 29, 2005 14:26:26

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

replaces_module


On 11/29/05, Grigory Fateyev <> wrote:
> as you see, lots of fields have the same fields from auth.users table.
> How to escape double of fields, and auth can work like in forum and in
> django?

To "remove" fields in the parent class, use "remove_fields". For example:

class User(users.User):
user_id = meta.IntegerField()
user_active = meta.CharField(maxlength=1)
username = meta.CharField(maxlength=25)
user_password = meta.CharField(maxlength=32)
user_session_time = meta.IntegerField()
user_session_page = meta.IntegerField()
user_lastvisit = meta.IntegerField()
user_regdate = meta.IntegerField()
user_level = meta.CharField(maxlength=4)
user_posts = meta.IntegerField()

class META:
db_table = 'anastas_users'
replaces_module = 'auth.users'
admin = meta.Admin()
# field names to remove from parent model
remove_fields =

Hope this answers your question,
Adrian

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

Offline

#3 Nov. 29, 2005 15:11:17

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

replaces_module


Hello Adrian Holovaty!
On Tue, 29 Nov 2005 08:26:11 -0600 you wrote:

> To "remove" fields in the parent class, use "remove_fields". For
> example:

> class META:
> db_table = 'anastas_users'
> replaces_module = 'auth.users'
> admin = meta.Admin()
> # field names to remove from parent model
> remove_fields =

How to be with field 'id'?

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

Offline

#4 Nov. 29, 2005 16:37:32

Cheng Z.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

replaces_module


On Nov 29, 2005, at 10:26 PM, Adrian Holovaty wrote:class META:
db_table = 'anastas_users'
replaces_module = 'auth.users'
admin = meta.Admin()
# field names to remove from parent model
remove_fields = Would you please elaborate this new meta option 'replaces_module',which I couldn't find in the doc?Thanks.

- Cheng

Offline

Board footer

Moderator control

Enjoy the 27th 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