~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to ivle/webapp/tutorial/__init__.py

  • Committer: Matt Giuca
  • Date: 2010-02-24 13:04:11 UTC
  • mfrom: (1700 trunk)
  • mto: This revision was merged to the branch mainline in revision 1701.
  • Revision ID: matt.giuca@gmail.com-20100224130411-s7acw3afckv8rudh
MergeĀ fromĀ trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
328
328
        URLNameValidator(not_empty=True))
329
329
    name = formencode.validators.UnicodeString(not_empty=True)
330
330
    assessable = formencode.validators.StringBoolean(if_missing=False)
 
331
    published = formencode.validators.StringBoolean(if_missing=False)
331
332
    data = formencode.validators.UnicodeString(not_empty=True)
332
333
    format = formencode.All(
333
334
        WorksheetFormatValidator(),
373
374
        ctx['data'] = data or {}
374
375
        ctx['offering'] = self.context
375
376
        ctx['errors'] = errors
 
377
        # If all of the fields validated, set the global form error.
 
378
        if isinstance(errors, basestring):
 
379
            ctx['error_value'] = errors
376
380
        ctx['formats'] = WORKSHEET_FORMATS
377
381
 
378
382
 
398
402
        new_worksheet.identifier = data['identifier']
399
403
        new_worksheet.name = data['name']
400
404
        new_worksheet.assessable = data['assessable']
 
405
        new_worksheet.published = data['published']
401
406
        new_worksheet.data = data['data']
402
407
        new_worksheet.format = data['format']
403
408
 
423
428
            'identifier': self.context.identifier,
424
429
            'name': self.context.name,
425
430
            'assessable': self.context.assessable,
 
431
            'published': self.context.published,
426
432
            'data': self.context.data,
427
433
            'format': self.context.format
428
434
            }
431
437
        self.context.identifier = data['identifier']
432
438
        self.context.name = data['name']
433
439
        self.context.assessable = data['assessable']
 
440
        self.context.published = data['published']
434
441
        self.context.data = data['data']
435
442
        self.context.format = data['format']
436
443