Custom Query (121 matches)
Results (4 - 6 of 121)
| Ticket | Resolution | Summary | Owner | Reporter |
|---|---|---|---|---|
| #168 | invalid | Appengine query models | xi | martinhoarantes@… |
| Description |
Hi, I´m using Google Appengine, language Python. I´d like to know how to query a model. I´m using this code, but the output is miserable: class GerarYAML(webapp.RequestHandler):
def post(self):
user = users.get_current_user()
if user:
formacaos = models.Formacao().all()
experiencias = models.Experiencia().all()
investigacaos = models.Investigacao().all()
distribuicaos = models.Distribuicao().all()
docentes = models.Docente.all()
docentes.filter('user =', users.get_current_user())
for docente in docentes:
for formacao in formacaos:
for experiencia in experiencias:
for investigacao in investigacaos:
for distribuicao in distribuicaos:
formacao.docente = docente.key()
'Nome: %s' % (docente.nome)
'Apelido: %s' % (docente.apelido)
'Unidade: %s' % (docente.unidade)
'Categoria: %s' % (docente.categoria)
'Regime: %s' % (docente.regime)
'Formacao: %s' % (formacao.formAno)
'Grau de Formacao: %s' % (formacao.formGrau)
'Area de Formacao: %s' % (formacao.formArea)
'Instituicao Academica: %s' % (formacao.formInstituicao)
'Classificacao Final: %s' % (formacao.formClassificacao)
yaml.dump(docente, sys.stdout)
yaml.dump(formacao, sys.stdout)
yaml.dump(experiencia, sys.stdout)
yaml.dump(investigacao, sys.stdout)
yaml.dump(distribuicao, sys.stdout)
self.response.headers['Content-Type'] = 'application/yaml'
self.response.headers['Content-Disposition'] = 'filename = my.yaml'
Can someone point out, how can i solve this issue? I´d like to download a file automatically when user submit a button with .yaml format and more or less formatted. |
|||
| #122 | wontfix | Bool tag doesn't accept all defined variants | xi | anonymous |
| Description |
One of the examples listed at http://yaml.org/type/bool.html will fail: >>> yaml.load('!!bool y')
Traceback (most recent call last):
...
KeyError: u'y'
|
|||
| #94 | fixed | Can't install pyyaml with easy_install on Mac OS X | xi | Stephen.Pascoe@… |
| Description |
Just thought I'd try out YAML on my Mac and did $ easy_install PyYaml ... unable to execute gcc: No such file or directory libyaml appears not to be installed (if libyaml is installed, you may need to specify the option --include-dirs or uncomment and modify the parameter include_dirs in setup.cfg) If I want to use YAML in my projects easy_install is pretty much essential. I don't know whether it works if gcc or libyaml is installed. |
|||
Note: See TracQuery
for help on using queries.
