Statistics
| Branch: | Tag: | Revision:

root / db / admin.py @ 52194743

History | View | Annotate | Download (1.7 kB)

1
from django.contrib import admin
2
from django import forms
3
from django.db import models
4
from django.utils.encoding import iri_to_uri
5
from django.utils.translation import gettext_lazy as _
6
from models import  *
7

    
8
class LimitForm(forms.ModelForm):
9
    class Meta:
10
        model = Limit
11

    
12
class LimitAdmin(admin.ModelAdmin):
13
    ""    
14

    
15
    form = LimitForm
16

    
17

    
18
class FlavorForm(forms.ModelForm):
19
    class Meta:
20
        model = Flavor
21

    
22
class FlavorAdmin(admin.ModelAdmin):
23
    ""    
24

    
25
    form = FlavorForm
26

    
27

    
28
class VirtualMachineForm(forms.ModelForm):
29
    class Meta:
30
        model = VirtualMachine
31

    
32
class VirtualMachineAdmin(admin.ModelAdmin):
33
    ""    
34

    
35
    form = VirtualMachineForm
36

    
37
class VirtualMachineGroupForm(forms.ModelForm):
38
    class Meta:
39
        model = VirtualMachineGroup
40

    
41
class VirtualMachineGroupAdmin(admin.ModelAdmin):
42
    ""    
43

    
44
    form = VirtualMachineGroupForm
45

    
46
class AccountingLogForm(forms.ModelForm):
47
    class Meta:
48
        model = AccountingLog
49

    
50
class AccountingLogAdmin(admin.ModelAdmin):
51
    ""    
52

    
53
    form = AccountingLogForm
54

    
55
class SynnefoUserForm(forms.ModelForm):
56
    class Meta:
57
        model = SynnefoUser
58

    
59
class SynnefoUserAdmin(admin.ModelAdmin):
60
    ""
61
    form = SynnefoUserForm
62

    
63
class ImageForm(forms.ModelForm):
64
    class Meta:
65
        model = Image
66

    
67
class ImageAdmin(admin.ModelAdmin):
68
    ""
69
    form = ImageForm
70

    
71

    
72
admin.site.register(Limit, LimitAdmin)
73
admin.site.register(SynnefoUser, SynnefoUserAdmin)
74
admin.site.register(Flavor, FlavorAdmin)
75
admin.site.register(VirtualMachine, VirtualMachineAdmin)
76
admin.site.register(VirtualMachineGroup, VirtualMachineGroupAdmin)
77
admin.site.register(AccountingLog, AccountingLogAdmin)
78
admin.site.register(Image, ImageAdmin)
79