Image : Balsamiq Mockup for Adding Maplayers on Arches Admin

Points to be noted : Every input field is re-sizable.
1) The ID Field is an integer and it has to be populated by the user.
2) The checkboxes can be rendered checked by default so that while creating a map layer, we have basic native values that are desired. ( ie : active=true, selectable=true, on map=true etc)
3) Name i18n key : The values for this content are taken from a pre-existing db called I18N which is also an app. First of all the i18n value is entered by the user and then this will get automatically populated like a checkbox. Screenshot attached :
4) Icon and Symbology have to be entered by the user. No preplanned logic for this applicable. It depends on the media files stored by the user.5) Description of i18n key can also be generated in the similar way but it has been kept blank by default so that user can fill in his words.6) Layergroup i18n key : This field has native value of Basemaps, which can be modified if required by the user.7) Layer : This is the most important field.I considered two options for this field :

  • generating dynamic content by json dump; which I figured can't be done in Admin because of security handles in django.
  • keeping the default content used by layer codes ie :

return new OpenLayers.Layer.INSERTLAYERNAME("REFNAME","IMAGELINKOPTIONAL",{ isBaseLayer: BOOLEAN, sphericalMercator: true, MINZOOM_LEVEL: Arches.config.App.mapConfig.minZoomLevel, opacity : 0.7 });

Then I will create a javascript, which will have certain pop-ups which will ask the values like INSERTLAYERNAME, REFNAME, IMAGELINK_OPTIONAL and BOOLEAN and generate the layer. This solution is the most elegant to what can be developed rather than dumping the json data, which is complex.

8) Sort Order : Planning on hiding this optional field. Values not important while creating the layer. This can be managed later as well.

Let me know what you think and feel free to contribute

Update :Finally got the form to display contents from other DB. Thanks to Brian McClure for helping me out. Here's the code : in admin.pya=I18N.objects.values('key') #a is bunch of dictionaries
keys = [dictionary['key'] for dictionary in a] #keys is a list
b = zip(keys,keys) #b is a comprehensive list
MaplayerForm.basefields['namei18n_key'] = forms.ChoiceField(choices=b) #kwarg