1
|
|
|
from django.contrib import admin |
2
|
|
|
from django import forms |
3
|
|
|
from .models import Dialog, DialogVar |
4
|
|
|
|
5
|
|
|
class DialogAdminForm(forms.ModelForm): |
6
|
|
|
|
7
|
|
|
class Meta: |
8
|
|
|
model = Dialog |
9
|
|
|
fields = '__all__' |
10
|
|
|
|
11
|
|
|
|
12
|
|
|
class DialogAdmin(admin.ModelAdmin): |
13
|
|
|
form = DialogAdminForm |
14
|
|
|
list_display = ['hash_entry', 'hash_id', 'callid', 'from_uri', 'from_tag', 'to_uri', 'to_tag', 'caller_cseq', 'callee_cseq', 'caller_route_set', 'callee_route_set', 'caller_contact', 'callee_contact', 'caller_sock', 'callee_stock', 'state', 'start_time', 'timeout', 'sflags', 'iflags', 'toroute_name', 'req_uri', 'xdata'] |
15
|
|
|
readonly_fields = ['hash_entry', 'hash_id', 'callid', 'from_uri', 'from_tag', 'to_uri', 'to_tag', 'caller_cseq', 'callee_cseq', 'caller_route_set', 'callee_route_set', 'caller_contact', 'callee_contact', 'caller_sock', 'callee_stock', 'state', 'start_time', 'timeout', 'sflags', 'iflags', 'toroute_name', 'req_uri', 'xdata'] |
16
|
|
|
|
17
|
|
|
admin.site.register(Dialog, DialogAdmin) |
18
|
|
|
|
19
|
|
|
|
20
|
|
|
class DialogVarAdminForm(forms.ModelForm): |
21
|
|
|
|
22
|
|
|
class Meta: |
23
|
|
|
model = DialogVar |
24
|
|
|
fields = '__all__' |
25
|
|
|
|
26
|
|
|
|
27
|
|
|
class DialogVarAdmin(admin.ModelAdmin): |
28
|
|
|
form = DialogVarAdminForm |
29
|
|
|
list_display = ['hash_entry', 'hash_id', 'dialog_key', 'dialog_value'] |
30
|
|
|
readonly_fields = ['hash_entry', 'hash_id', 'dialog_key', 'dialog_value'] |
31
|
|
|
|
32
|
|
|
admin.site.register(DialogVar, DialogVarAdmin) |
33
|
|
|
|
34
|
|
|
|
35
|
|
|
|