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
#!/bin/sh | |
FOLDER=$2 | |
DOMAIN=$1 | |
SITE=$DOMAIN | |
wget --recursive --convert-links --domains $DOMAIN --no-parent --page-requisites --html-extension --no-clobber --restrict-file-names=unix $SITE | |
cd $SITE | |
for i in `find -type d`; do touch $i/index.html; done; |
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
>>> import cPickle | |
>>> d = [{'help_text': u'Nome completo da pessoa', 'label': u'Nome', 'type': 'text'}] | |
>>> cPickle.dumps(d) | |
"(lp1\n(dp2\nS'help_text'\np3\nVNome completo da pessoa\np4\nsS'type'\np5\nS'text'\np6\nsS'label'\np7\nVNome\np8\nsa." | |
>>> s = cPickle.dumps(d) | |
>>> cPickle.loads(s) | |
[{'help_text': u'Nome completo da pessoa', 'label': u'Nome', 'type': 'text'}] |
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
### on my forms.py, a function to generate this form | |
def make_revision_form(account): | |
revision_type = account.program.revision_type | |
hints = revision_type.get_hints() | |
fields = {'revision_field': forms.CharField(widget=forms.HiddenInput, required=False), | |
'account_id': forms.CharField(widget=forms.HiddenInput, required=False, initial=account.id)} | |
for i, hint in enumerate( hints ): | |
fields['grade_%d'%(len(hints)-i)] = forms.CharField( | |
label="Critério %s"%chr(i+65), help_text=hint, | |
required=True) |