Login | Register
My pages Projects Community openCollabNet

Discussions > commits > svn commit: r3 - trunk/www/index.html

lawngnome
Discussion topic

Back to topic list

svn commit: r3 - trunk/www/index.html

Reply

Author begby
Full name Jeff Dorsch
Date 2006-06-05 06:49:53 PDT
Message Author: Begby
Date: 2006-06-05 06:49:52-0700
New Revision: 3

Modified:
   trunk/www/index.html

Log:
""

Modified: trunk/www/index.html
Url: http://lawngnome.tig​ris.org/source/brows​e/lawngnome/trunk/ww​w/index.html?view=di​ff&rev=3&p1=​trunk/www/index.html​&p2=trunk/www/in​dex.html&r1=2​&r2=3
====================​====================​====================​==================
--- trunk/www/index.html (original)
+++ trunk/www/index.html 2006-06-05 06:49:52-0700
@@ -13,94 +13,150 @@
 </head>
 <body>
 
-<p>This is the initial web content for your project. Please customize
-this to fit your project. You don't need to answer all these questions
-or follow this exact format, but we do like to see this kind of
-information before we approve projects for public viewing.
-</p>
+<h3>Mission</h3>
 
-<p>Until your project is approved, only you can view it and work on
-it.
+<p>Lawngnome is a php 5 database model loosely based on the Django model. The goal is to have a very
+flexible model library that can be used in any framework. The model will handle joins and also multi-table
+heirarchies created by extending models. The proposed features are as follows:
 </p>
 
+
 <ul>
-<li>This index.html will be used if and only if you have the "Use
-Project Home Page" option checked on the "Administer Project" page
-(click the "Admin" tab).</li>
+ <li>Class structure extensible at the model, table, or field level</li>
+ <li>Ability to predefine relationships and joins, or create relationships at runtime</li>
+ <li>Ability to predefine a model, or create/modify it at runtime</li>
+ <li>Models have the optional ability to render html form fields using a set of extensible HTML widget objects.</li>
+ <li>Easy to use syntax with heavy use of overloading and SPL allowing you to access model properties and subobjects through an array-like interface.</li>
+ <li>Auto-admin interface for objects that implement a model and queryset interface</li>
+ <li>Predefined extensible objects that implement the model interface for complex structures such as a pre-order nested set tree</li>
+ <li>As a later milestone implement autogenerating models from existing databases, create tables from a model, or create models from an XML defenition</li>
+</ul>
 
-<li>To edit this file, check out your project via CVS and edit www/index.html.
 
-<li>You can 'cvs add' and commit other files under the project's "www"
-directory and they will published to your project web site.</li>
+<h3>Why one more DB abstraction class?</h3>
 
-<li>Also, consider starting a thread in the "dev" mailing list to get
-these discussion started. A good one is an "introduction" thread where
-people post messages about themselves and their interest in the
-project.</li>
+<p>Lawngnome is meant to be quick to deploy, easy to setup and use, and not require special
+configuration scripts, compiling, or xml definitions. Additionally it uses a verbose syntax for
+accessing and defining object properties and for declaring models. Taking advantage of the input
+widgets can also provide reusable and easy to deploy forms with built in data validation.</p>
 
-<li>You can add a "Highlights:" line to the top of all web pages by adding a file www/project_highlights.html </li>
-</ul>
+<p>Lawngnome is completely independent of any framework and will stay that way</p>
 
 
-<h3>Mission</h3>
 
-<p>What is the goal of this project?
-</p>
+<h3>Class Overview</h3>
 
-<p>What is the scope of this project?
-</p>
+<h4>HTMLWidge​ts</h4>
+<p>The widgets are optional helpers used to render form fields. The class is easy to extend and modify
+to allow custom fields to be created and reused</p>
 
-<p>For example:</p>
+<h4>DataField</h4>
+<p>The datafield is a representation of an individual field. This object has a validator and sometimes
+a widget as a member. This field is also relatively simple to extend and has many methods which can be
+overridden.</p>
+<p>Joins are created using a datafield that acts as an adapter
+to other models demonstrating the flexibility of extending the abstract datafield class.</p>
+
+<h4>Model</h4>
+<p>The model is a collection of fields and/or models and is reponsible for updates, inserts, and deletes
+on a single model instance. The model also returns information about the modeled database structure
+such as field names, table names, and join clauses.</p>
 
-<ul>
-<li>Develop just enough functionality to scratch a particular itch</li>
-<li>Build a tool just like XYZ, but less broken</li>
-<li>Build the best XYZ-tool ever!</li>
-</ul>
 
+<h4>QuerySet</h4>
+<p>The queryset object is used to query the database and create model collections from query results</p>
 
-<p>What are high-level features you are sure to build?
+<h3>Quick and Dirty Usage Example</h3>
+<p>
+At first glance this does everything that every other db class out there does
 </p>
-<ul>
 
-<li>What would you write on a billboard about your project? Users
-might only look for a few seconds.</li>
+<p>
+<code>
+$model = new MyModel() ;<br />
+$model->find(3) ; <-- Fetch by primary key <br />
+$model->myfield = 'somevalue' ; <-- Change the value<br />
+$model->save() ; <-- Update it
+</code>
+</p>
 
-<li>Use the issue tracker to track features and enhancement
-requests. It is not just for bugs, pre-populate it with feature
-descriptions so that potential contributors know what you would like them
-to work on.</li>
-</ul>
 
-<p>What are the high-level assumptions or ground rules for the project?
+<p>
+<strong>Field access</strong><br />
+However, lawngnome is able to access individual fields as objects or values
 </p>
 
-<p>For example:
+<p>
+<code>
+$model->myfield ; // Gets the field value <br />
+$model['myfield'] ; // Access the field as an object <br />
+echo $model->myfield ; // echo the raw value <br />
+echo $model['myfield'] ; // Call __toString() on the datafield <br />
+&nbsp; <br />
+echo $model['foreignkey'​]->foreignfield ; // Access a foreign field value from a related model <br />
+</code>
 </p>
 
-<ul>
-<li> we will use programming language X on operating system Y for now.
 
-<li>We will, or will not, consider certain functional areas like
-internationalization, high security, concurrency, etc. The list of
-functional areas will depend on what you are trying to do.
+<p>
+<strong>Field Rendering</strong><br />
+Lawngnome can also render form fields and change validation on the fly
+</p>
 
-<li>Try to keep this part short.
-</ul>
+<p>
+<code>
+// Given a field that uses a text widget input<br />
+$model->['field​']->input()->s​ize(10)->maxlengt​h(20) ; <br />
+echo $model->input(); // Draw the form field<br />
+&nbsp;<br />
+// Setup the password field so that it is required with a min length of 8<br />
+// then pass the value to php's md5() before inserts or updates<br />
+$model->['passw​ord']->validator(​)->required->m​in_length(8)->md5​ ;
+</code>
+</p>
 
 
-<h3>Related resources</h3>
 
-<ul>
-<li>Link to other stuff that you know about. It will help you
-research requirements and provide a useful resource to potential
-contributors.</li>
+<p><strong>SPL implementation</s​trong></p>
 
-<li>Why reinvent the wheel? What is better about this wheel? Is there
-any existing project that you can partner with or reuse?</li>
 
-<li>Where would you go to try to find potential contibutors?</li>
-</ul>
+<p>
+<code>
+// Loop through all the datafields in the root model and draw input<br />
+foreach( $model as $datafield )<br />
+{<br />
+ echo $datafield->input() ;<br />
+}<br />
+&nbsp;<br />
+// Recursively loop through all joined fields, validate and then draw form input<br />
+foreach( $model->GetRecur​siveIterator() as $datafield )<br />
+{<br />
+ if( !$datafield->validate() ) echo $datafield->vali​dator()->error() ;<br />
+ echo $datafield->input() ;<br />
+}<br />
+&nbsp;<br />
+// Loop through all the html parameters of an html widget<br />
+foreach( $model['myfield']->input() as $param => $value )<br />
+{<br />
+ echo $param.':'.$value ;<br />
+}<br />
+</code>
+</p>
+
+<p>
+<strong>QuerySet Usage</strong>
+</p>
+
+
+<p>
+<code>
+$query = new QuerySet( 'modelname' ) ;<br />
+$modelobjects = $query->fieldnam​e->EQ('10')->o​therfield->LIKE('​%val')->mydate-​>GTE(time())->Ru​nQuery() ;<br />
+</code>
+</p>
+
+
+<p>The above is only a portion of the features, full documentation coming soon.</p>
 
 </body>
 </html>

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

svn commit: r3 - trunk/www/index.html begby Jeff Dorsch 2006-06-05 06:49:53 PDT
Messages per page: