~ubuntu-branches/debian/jessie/phatch/jessie

« back to all changes in this revision

Viewing changes to phatch/lib/formField.py

  • Committer: Bazaar Package Importer
  • Author(s): Stani M
  • Date: 2009-10-11 19:07:45 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20091011190745-jofr6ykc17mentlf
Tags: 0.2.3-1
Upstream bugfix release (Closes LP: #448845, #446725, #445943)

Show diffs side-by-side

added added

removed removed

Lines of Context:
396
396
 
397
397
#---fields
398
398
 
 
399
def set_safe(state):
 
400
    Field.safe = state
 
401
 
 
402
 
 
403
def get_safe():
 
404
    return Field.safe
 
405
 
 
406
 
399
407
class Field(object):
400
408
    """Base class for fields. This needs to be subclassed but,
401
409
    never used directly.
513
521
        self.value_as_string = self.to_string(x)
514
522
 
515
523
    @staticmethod
516
 
    def set_safe(state):
517
 
        Field.safe = state
518
 
 
519
 
    @staticmethod
520
524
    def set_globals(_globals):
521
525
        Field._globals = _globals
522
526
 
668
672
    def set_choices(self, choices):
669
673
        self.choices = choices
670
674
        if not (self.get_as_string() in choices):
671
 
            self.set_as_string(choices[0])
 
675
            self.set_as_string_dirty(choices[0])
672
676
 
673
677
 
674
678
class FolderField(NotEmptyCharField):