← Back to team overview

launchpad-dev team mailing list archive

Re: Parsing/validating work items

 

On 21/02/12 20:27, William Grant wrote:
> On 22/02/12 06:12, Guilherme Salgado wrote:
>> Hi,
>> (resending this as I wasn't subscribed to the list when I sent the first
>> time; I apologise in advance if you get this twice)
>>
>> As we've mentioned earlier the new UI to edit work items is going to be
>> basically the same thing we currently have, that is, a text area with
>> one work item per line, with optional headings to target certain work
>> items to a milestone.  The main difference is that now we need to parse
>> that and create/update/delete SpecificationWorkItem objects for every row.
> 
> This sounds pretty similar to source package recipes. A textarea is
> parsed into a SourcePackageRecipeData, which is a sequence of
> SourcePackageRecipeDataInstructions plus a header.

Indeed, and it does parse the recipe twice: once when validating the
form data (in RecipeTextValidatorMixin) and again when creating/updating
the SourcePackageRecipe. Although in this case the parsing doesn't
involve any DB access.

-- 
Guilherme Salgado <https://launchpad.net/~salgado>

Attachment: signature.asc
Description: OpenPGP digital signature


References