Author: annis
Date: 2010-02-14 02:42:03 +0100 (Sun, 14 Feb 2010)
New Revision: 28017

Added:
   plugins/ahDoctrineEasyEmbeddedRelationsPlugin/trunk/TODO
Log:
[ahDoctrineEasyEmbeddedRelationsPlugin] added a TODO with information on 
versions 1.2 and 1.5 (roadmap, so to speak)

Added: plugins/ahDoctrineEasyEmbeddedRelationsPlugin/trunk/TODO
===================================================================
--- plugins/ahDoctrineEasyEmbeddedRelationsPlugin/trunk/TODO                    
        (rev 0)
+++ plugins/ahDoctrineEasyEmbeddedRelationsPlugin/trunk/TODO    2010-02-14 
01:42:03 UTC (rev 28017)
@@ -0,0 +1,39 @@
+# TODO #
+## Version 1.2 ##
+
+    * check for LocalKey/ForeignKey relation? Because it's only possible now 
to 
+      correctly embed relations that have a field in them that corresponds to 
one 
+      of the field in the embedding form:
+          * ahProjectmanagerProject (APP) embeds 
ahProjectmanagerSubversionRepository (APSR), 
+            where APSR has the project_id field that corresponds to APP's id 
field
+        This is a problem because:
+          * APP embeds sfGuardUser (SGU), where SGU has no field that 
corresponds to APP's id field
+            *but* APP has a user_id field that corresponds to SGU's id field!
+    * check for one-to-one relations because if the relation exists there's no 
need for an "Add new" form!
+
+## Version 1.5 ##
+
+    * try improving and abstracting the functionality to ignore empty "add 
new" forms so this does not have 
+      to be managed in the embedding form class anymore
+        - 1st option is to add a `considerEmptyFields` method to the embedded 
form class (easy to implement, no need to 
+          update the embedding form class when the embedded form's model 
changes (add/remove fields), which could be forgotten
+        - 2nd option is trying to figure out after submit if the form to add a 
new related record can be considered empty:
+            * remove all validators that are optional and are empty (needs to 
be both because the user can also enter something non-required!)
+            * if the form then has the maximum errors that can exist in the 
form then the form is empty because the user 
+              did not change anything or filled in any information
+            Example:
+              * sfGuardUser model
+              * fields: username, firstname, lastname, gender, zip, city
+              * username, firstname, and lastname are mandatory
+              * gender, zip, and city are optional
+              * on submit:
+                * the optional fields are all tested for emptiness 
($validator->isEmpty()), 
+                  if one is not empty, form is considered "not empty"
+                * the rest is tested for number of errors so I need to know 
the maximum number of errors 
+                  that can be thrown from there; if this number is equal to 
the number of errors the form has thrown 
+                  after validation then - bingo! - the form is considered 
"empty"
+            
+      => URLS:
+          * 
http://www.symfony-project.org/more-with-symfony/1_4/en/05-Custom-Widgets-and-Validators
+          * 
http://www.symfony-project.org/more-with-symfony/1_4/en/06-Advanced-Forms#chapter_06_sub_rendering_each_form_field_with_sfformfield
+          * 
http://www.symfony-project.org/forms/1_2/en/02-Form-Validation#chapter_02_global_validators
\ No newline at end of file

-- 
You received this message because you are subscribed to the Google Groups 
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/symfony-svn?hl=en.

Reply via email to