[dfv] backing out defaults_regexp_map?
Status: Inactive
Brought to you by:
markjugg
From: Mark S. <ma...@su...> - 2006-10-31 03:40:03
|
I recently added 'defaults_regexp_map' to the development version, as what I thought would be a logical complement to the other regexp features we offer. However, once I actually tried to use it, I'm not sure it actually makes sense, and am considering backing it out now. Here's the rub: There's no point in declaring defaults as a regular expression unless the corresponding optional and/or required fields are also given as a regular expression. Otherwise, the data structure could be used to generate both parts of the profile. However, setting defaults is about dealing with fields that don't exist, by looking at which ones we know would be required or optional. The problem is, when we hope to use optional_regexp and defaults_regexp_map with the same field, the default doesn't set if the field is missing. That's because the field can't be optional_regexp (there's nothing to match!). And thus, because we don't know that the field should be optional, we can't set a default with defaults_regexp_map. Considering that, is there is some other "use case" where defaults_regexp_map would actually be useful? It would be a scenerio where somehow you need the optional and/or required field definitions to be hardcoded, but the defaults to be generated on the fly. Mark -- http://mark.stosberg.com/ |