from django.db import models
class users(models.Model):
ban_chouse = (
('1', 'Заблокирован'),
('0', 'Не Заблокирован'),
)
admin_chouse = (
('1', 'Да'),
('0', 'Нет'),
)
userid = models.TextField(verbose_name = 'Ид'),
username = models.TextField(verbose_name = '@username'),
usernick = models.TextField(verbose_name = 'Имя'),
usertag = models.TextField(verbose_name = 'Тег'),
reps = models.CharField(verbose_name = 'Баланс'),
date_reg = models.CharField(max_length = 3500,verbose_name = 'Дата регистрации'),
questions = models.TextField(verbose_name = 'Ответы на вопросы'),
status = models.TextField(verbose_name = 'Активирован',choices=admin_chouse, default='0'),
ban = models.CharField(max_length = 3500,verbose_name = 'Блокировка',choices=ban_chouse, default='0')
rank = models.TextField(verbose_name = 'Ранг'),
domens = models.TextField(verbose_name = 'Домены'),
user_nick = models.TextField(verbose_name = 'Пользовательский ник'),
admin = models.CharField(max_length = 3500,verbose_name = 'Есть доступ к админке?',choices=admin_chouse, default='0'),
strakes = models.CharField(max_length = 3500,verbose_name = 'Количество страйков')
class Meta:
verbose_name = 'Пользователь'
verbose_name_plural = 'Пользователи'
from django.contrib import admin
from .models import users
from django.forms import TextInput, Textarea
from django.db import models
@admin.register(users)
class ProfileAdmin(admin.ModelAdmin):
list_display = ('id','userid','username','usernick','usertag','reps','date_reg','questions','status','ban','rank','domens','user_nick','admin','strakes')
fields = ['userid','username','usernick','usertag','date_reg','questions','status','ban','rank','domens','user_nick','admin',('strakes','reps')]
search_fields = ['userid','username','usernick','usertag','reps','date_reg','questions','status','ban','rank','domens','user_nick','admin','strakes']
class ProfileAdmin(admin.ModelAdmin):
list_display = ('id','userid','username','usernick','usertag','reps','date_reg','questions','status','ban','rank','domens','user_nick','admin','strakes')
fields = ['userid','username','usernick','usertag','date_reg','questions','status','ban','rank','domens','user_nick','admin',('strakes','reps')]
search_fields = ['userid','username','usernick','usertag','reps','date_reg','questions','status','ban','rank','domens','user_nick','admin','strakes']
admin.site.register(users, ProfileAdmin )