Leslie P. Polzer wrote:
> * I'm interested especially in (2)
> * What's the rationale for doing (1)? Advantages?
> * The changeset needs to be separated in any case
>
I wrote this code during my current work on generating CRUD search
forms
from existing views (mostly done and will be available soon) where I
want:
1. Avoid retyping 90% of code for new form by hands when I only want
to
change reader or writer of field.
2. Create new fields dynamically to add new search criteria.
By example from current test code:
(defview flat-form-view
(:type form
:inherit-from '(:scaffold flat))
(house :present-as (dropdown :choices #'all-houses
:label-key #'house-address
:welcome-name (humanize-name 'house))
:parse-as (object-id :class-name 'house)
:writer (make-slot-writer 'house-id #'house-id)
:reader #'flat-house-id))
With field inheritance I can write:
(defview flat-search-view
(:type search
:inherit-from 'flat-form-view)
(house :writer nil
:reader #'house-id))
Without field's inheritance I need to retype all code for any field
I want to change slightly only. But I'm lazy :)
Best Regards,
Vladimir Sekissov
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"weblocks" 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/weblocks?hl=en
-~----------~----~----~----~------~----~------~--~---