Re: replaces_module

2005-11-29 Thread Cheng Zhang



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 = ['password', 'is_staff', 'is_superuser']


Would you please elaborate this new meta option 'replaces_module',  
which I couldn't find in the doc?

Thanks.

- Cheng



Re: replaces_module

2005-11-29 Thread Grigory Fateyev

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 = ['password', 'is_staff', 'is_superuser']

How to be with field 'id'?

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


replaces_module

2005-11-29 Thread Grigory Fateyev

Hello!

I have forum on phpbb (about 2 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 [at] anastasia [dot] ru Григорий.