Statistics
| Branch: | Revision:

root / crm / robocrm / admin.py @ 95250ecf

History | View | Annotate | Download (778 Bytes)

1
from robocrm.models import Machine
2
from robocrm.models import Event
3
from robocrm.models import Project
4
from robocrm.models import RoboResource
5
from django.contrib import admin
6
from django.contrib.auth.admin import UserAdmin
7
from django.contrib.auth.models import User
8
from robocrm.models import RoboUser
9

    
10
class UserProfileInLine(admin.StackedInline):
11
  model = RoboUser
12
  can_delete=False
13
  verbose_name_plural = 'profile'
14

    
15
class UserAdmin(UserAdmin):
16
  inlines = (UserProfileInLine, )
17
  list_display = ('username', 'email', 'first_name', 'last_name')
18
  search_fields = ['username', 'email']
19

    
20
admin.site.unregister(User)
21
admin.site.register(User, UserAdmin)
22
admin.site.register(Machine)
23
admin.site.register(Event)
24
admin.site.register(Project)
25
admin.site.register(RoboResource)
26