|
@@ -2,9 +2,20 @@
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
|
from django.contrib import admin
|
|
|
+from django.forms import ModelForm
|
|
|
+
|
|
|
+from localflavor.fr.forms import FRPhoneNumberField
|
|
|
|
|
|
from coin.isp_database.models import ISPInfo, RegisteredOffice, OtherWebsite, ChatRoom, CoveredArea, BankInfo
|
|
|
|
|
|
+class ISPAdminForm(ModelForm):
|
|
|
+
|
|
|
+ class Meta:
|
|
|
+ model = ISPInfo
|
|
|
+
|
|
|
+ phone_number = FRPhoneNumberField(required=False,
|
|
|
+ help_text='Main contact phone number')
|
|
|
+
|
|
|
|
|
|
class SingleInstanceAdminMixin(object):
|
|
|
"""Hides the "Add" button when there is already an instance"""
|
|
@@ -82,5 +93,7 @@ class ISPInfoAdmin(SingleInstanceAdminMixin, admin.ModelAdmin):
|
|
|
CoveredAreaInline)
|
|
|
save_on_top = True
|
|
|
|
|
|
+ # Use custom form
|
|
|
+ form = ISPAdminForm
|
|
|
|
|
|
admin.site.register(ISPInfo, ISPInfoAdmin)
|