This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Define a base form that provides the following functionality for its children: | |
# ~ Children may use the 'notes' field with some default values set; | |
# * Children may use the 'notes' field with some customizations; | |
# * Children may choose not to use the 'notes' field | |
# | |
# I've omitted case 1 (marked with a ~) because the interesting stuff is in case 2 (CustomizedNotesLeadRequestForm) and 3 (NoNotesLeadRequestForm) | |
class BaseLeadRequestForm(ModelForm): | |
class Meta: | |
fields = ('notes', 'other_field') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Verifying I am +dagan on my passcard. https://onename.com/dagan |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Before: | |
# { bar, "Difficulty speaking", "How hard?", foo }, | |
# After: | |
# { bar, "difficulty_speaking", "how_hard", foo }, | |
def fix_key(bad_key) | |
bad_key.downcase.gsub(/[?:]/, '').gsub('/', ' ').gsub(' ', '_') | |
end | |
def fix_info(bad_info) |