Statistics
| Branch: | Tag: | Revision:

root / snf-cyclades-app / synnefo / db / admin.py @ f10a0657

History | View | Annotate | Download (3.3 kB)

1
# Copyright 2011 GRNET S.A. All rights reserved.
2
#
3
# Redistribution and use in source and binary forms, with or without
4
# modification, are permitted provided that the following conditions
5
# are met:
6
#
7
#   1. Redistributions of source code must retain the above copyright
8
#      notice, this list of conditions and the following disclaimer.
9
#
10
#  2. Redistributions in binary form must reproduce the above copyright
11
#     notice, this list of conditions and the following disclaimer in the
12
#     documentation and/or other materials provided with the distribution.
13
#
14
# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
15
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17
# ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
18
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24
# SUCH DAMAGE.
25
#
26
# The views and conclusions contained in the software and documentation are
27
# those of the authors and should not be interpreted as representing official
28
# policies, either expressed or implied, of GRNET S.A.
29

    
30
from django.contrib import admin
31
from django import forms
32
from synnefo.db.models import  *
33

    
34
class LimitForm(forms.ModelForm):
35
    class Meta:
36
        model = Limit
37

    
38
class LimitAdmin(admin.ModelAdmin):
39
    ""    
40

    
41
    form = LimitForm
42

    
43

    
44
class FlavorForm(forms.ModelForm):
45
    class Meta:
46
        model = Flavor
47

    
48
class FlavorAdmin(admin.ModelAdmin):
49
    ""    
50

    
51
    form = FlavorForm
52

    
53

    
54
class VirtualMachineForm(forms.ModelForm):
55
    class Meta:
56
        model = VirtualMachine
57

    
58
class VirtualMachineAdmin(admin.ModelAdmin):
59
    ""    
60

    
61
    form = VirtualMachineForm
62

    
63
class VirtualMachineGroupForm(forms.ModelForm):
64
    class Meta:
65
        model = VirtualMachineGroup
66

    
67
class VirtualMachineGroupAdmin(admin.ModelAdmin):
68
    ""    
69

    
70
    form = VirtualMachineGroupForm
71

    
72
class DebitForm(forms.ModelForm):
73
    class Meta:
74
        model = Debit
75

    
76
class DebitAdmin(admin.ModelAdmin):
77
    ""    
78

    
79
    form = DebitForm
80

    
81
class SynnefoUserForm(forms.ModelForm):
82
    class Meta:
83
        model = SynnefoUser
84

    
85
class SynnefoUserAdmin(admin.ModelAdmin):
86
    ""
87
    form = SynnefoUserForm
88

    
89
class ImageForm(forms.ModelForm):
90
    class Meta:
91
        model = Image
92

    
93
class ImageAdmin(admin.ModelAdmin):
94
    ""
95
    form = ImageForm
96

    
97

    
98

    
99
class VirtualMachineMetadataForm(forms.ModelForm):
100
    class Meta:
101
        model = VirtualMachineMetadata
102

    
103
class VirtualMachineMetadataAdmin(admin.ModelAdmin):
104
    ""
105
    form = VirtualMachineMetadataForm
106

    
107

    
108

    
109
admin.site.register(Limit, LimitAdmin)
110
admin.site.register(VirtualMachineMetadata, VirtualMachineMetadataAdmin)
111
admin.site.register(SynnefoUser, SynnefoUserAdmin)
112
admin.site.register(Flavor, FlavorAdmin)
113
admin.site.register(VirtualMachine, VirtualMachineAdmin)
114
admin.site.register(VirtualMachineGroup, VirtualMachineGroupAdmin)
115
admin.site.register(Debit, DebitAdmin)
116
admin.site.register(Image, ImageAdmin)
117