Skip to content
Browse files

add DEVELOPERS.md file

  • Loading branch information...
1 parent 6d3e8a7 commit 2d8f62ede80cbc0dc92d31c548686ed679c83432 @sergiocharpineljr sergiocharpineljr committed Aug 18, 2012
Showing with 27 additions and 0 deletions.
  1. +27 −0 DEVELOPERS.md
View
27 DEVELOPERS.md
@@ -0,0 +1,27 @@
+# ISPDB
+
+ISPDB is a Django front-end to figure out workflow of ISP database info for the Thunderbird autoconfig database.
+
+This file contains useful informations to help developers.
+
+## Documentation
+
+### Models
+
+ISPDB has the following models: Domain, DomainRequest, Config, Issue, DocURL, DocURLDesc, EnableURL, EnableURLInst.
+
+Both Domain and DomainRequest represent a mail domain. The difference is that DomainRequest is not approved yet. It means that users can vote on it and their name attribute is not unique (we can have more than one DomainRequest with the same name). A Config holds the domain configuration. It can be related to more than one domain. It has zero or more documentation pages (DocURL) and zero or more enable pages (EnableURL). A DocURL has one or more descriptions (DocURLDesc) and a EnableURL has one or more instructions (EnableURLInst). Because those 4 classes are very similar, we have created common model and form classes.
+
+The Issue model represents a reported issue. It is related to the configuration and optionally to an user suggested configuration.
+
+### Forms
+
+The forms complexity in in the forms classes. For example, ConfigForm class has domain_formset, docurl_formset and enableurl_formset attributes. So we can do things like the save_all method which save all of the forms (Domain, Config, DocURL, EnableURL), simplifying the views.
+
+Also there are two nested forms (for DocURL and EnableURL models). So each DocURLForm has a DocURLDesc formset and each EnableURLForm has a EnableURLInst formset.
+
+It is possible to add new forms dynamically in all of the formsets. There are two form classes to help with this task: DynamicModelForm and DynamicBaseModelFormSet. Basically they add a DELETE hidden boolean field and a overriden empty_form attribute (see below).
+
+#### Dynamic Forms
+
+enter_config.html template has hidden textarea elements which contains empty forms. These empty forms have on their attributes JQuery Validation tags, in our case "{1}-{0}" string, which are replaced with a form prefix and a index.

0 comments on commit 2d8f62e

Please sign in to comment.
Something went wrong with that request. Please try again.