Changeset 13028 for trunk


Ignore:
Timestamp:
05/27/11 17:15:01 (13 years ago)
Author:
sil
Message:
  • Changed some things in the admin interface
  • Removed constraint for uniqueness of combination of hwaddress and ip
Location:
trunk/sara_cmt/sara_cmt/cluster
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sara_cmt/sara_cmt/cluster/admin.py

    r13027 r13028  
    7474class HardwareUnitAdmin(admin.ModelAdmin):
    7575    fieldsets = (
    76         ('Host info', {'fields': (('cluster', 'label', 'state', 'role'), )}),
    77         ('Involved parties', {'fields': ('seller', 'owner')}),
     76        ('Host info', {'fields': (('cluster', 'label'),)}),
     77        ('Configuration', {'fields': (('state', 'role'),)}),
    7878        ('Machine specifications', {'fields': ('specifications', 'warranty',
    7979                                               'warranty_tag', 'serial_number')}
    8080        ),
    8181        ('Physical location', {'fields': (('rack', 'first_slot'),)}),
     82        ('Involved parties', {'fields': ('seller', 'owner')}),
    8283        GlobalAdmin.extra_fieldset)
    8384
     
    8990    search_fields = ('label', 'warranty_tag')
    9091
    91     #filter_horizontal = ('role',)
    92 
    9392
    9493class CountryAdmin(admin.ModelAdmin):
     
    101100
    102101class AddressAdmin(admin.ModelAdmin):
    103     #date_hierarchy = 'created_on'
    104102    fieldsets = (
    105103        ('Location', {'fields': ('address', 'postalcode', 'city', 'country'),
     
    138136        (None, {'fields': (('room', 'label', 'capacity'),)}),
    139137        GlobalAdmin.extra_fieldset)
    140     list_display = ('address', 'room', 'label')
     138    list_display = ('label', 'address', 'room')
    141139    list_filter  = ('room',) + GlobalAdmin.list_filter
    142140
     
    144142class InterfaceAdmin(admin.ModelAdmin):
    145143    fieldsets = (
    146         ('Physical', {'fields': (('iftype', 'host'), 'hwaddress', 'ip')}),
     144        ('Physical', {'fields': (('iftype', 'host'), ('hwaddress', 'ip'))}),
    147145        ('Network', {'fields': ('network', ('label', 'aliases'))}),
    148146        GlobalAdmin.extra_fieldset)
    149     list_display = ('__unicode__', 'hwaddress', 'ip', 'network', 'iftype')
     147    list_display = ('__unicode__', 'network', 'hwaddress', 'ip', 'iftype')
    150148    list_filter  = ('network', 'iftype') + GlobalAdmin.list_filter
    151149    search_fields = ('label', 'aliases', 'hwaddress', 'ip', 'host__label')
     
    154152class InterfaceTypeAdmin(admin.ModelAdmin):
    155153    fieldsets = (
    156         ('Properties', {'fields': ('label', 'vendor')}),
     154        ('Properties', {'fields': (('label', 'vendor'),)}),
    157155        GlobalAdmin.extra_fieldset)
    158156    list_display = ('label', 'vendor')
     
    170168    fieldsets = (
    171169        ('Vendor-specific', {'fields': ('vendor', 'name', 'vendorcode')}),
    172         ('Dimensions', {'fields': ('expansions', 'rackspace')}),
     170        ('Dimensions', {'fields': (('rackspace', 'expansions'),)}),
    173171        GlobalAdmin.extra_fieldset)
    174172
     
    183181        GlobalAdmin.extra_fieldset)
    184182    list_display = ('name', 'vlan', 'cidr', 'gateway', 'domain', 'hostnames',
    185                     '_max_hosts', 'count_ips_assigned', 'count_ips_free')
     183                    'count_ips_assigned', 'count_ips_free')
    186184    list_filter  = GlobalAdmin.list_filter
    187185
     
    208206class WarrantyContractAdmin(admin.ModelAdmin):
    209207    fieldsets = (
    210         (None, {'fields': ('label', ('warranty_type', 'contract_number', 'annual_cost'))}),
     208        (None, {'fields': (('label', 'warranty_type'), ('contract_number', 'annual_cost'))}),
    211209        ('Period', {'fields': (('date_from', 'date_to'),)}),
    212210        GlobalAdmin.extra_fieldset)
     
    218216class WarrantyTypeAdmin(admin.ModelAdmin):
    219217    fieldsets = (
    220         (None, {'fields': ('label', 'contact')}),
     218        (None, {'fields': (('label', 'contact'),)}),
    221219        GlobalAdmin.extra_fieldset)
    222220
  • trunk/sara_cmt/sara_cmt/cluster/models.py

    r13019 r13028  
    165165
    166166    class Meta:
    167         unique_together = (('network', 'ip'), ('network', 'hwaddress'))
     167        unique_together = ('network', 'hwaddress')
    168168        ordering = ('host__cluster__name', 'host__rack__label', 'host__first_slot')
    169169
Note: See TracChangeset for help on using the changeset viewer.