Re: [google-appengine] Problem with app?

2013-12-06 Thread Nuno Maltez
Missing the : after the class definition?

class travianVillage():




On Tue, Dec 3, 2013 at 4:26 AM, Tuukka Karvonen tuukka.p.karvo...@gmail.com
 wrote:

 Traceback (most recent call last):
   File 
 /base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/runtime/wsgi.py,
  line 239, in Handle
 handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
   File 
 /base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/runtime/wsgi.py,
  line 298, in _LoadHandler
 handler, path, err = LoadObject(self._handler)
   File 
 /base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/runtime/wsgi.py,
  line 84, in LoadObject
 obj = __import__(path[0])
   File /base/data/home/apps/s~taviaaneri/1.372063387188544851/main.py, line 
 178
 class travianVillage()
  ^
 SyntaxError: invalid syntax

 # Can anyone expain me what is wrong here. I keep getting server error when I 
 try to use my app and haven't got any clue which causes it.

 //Tuukka

  --
 You received this message because you are subscribed to the Google Groups
 Google App Engine group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-appengine+unsubscr...@googlegroups.com.
 To post to this group, send email to google-appengine@googlegroups.com.
 Visit this group at http://groups.google.com/group/google-appengine.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [google-appengine] Issue with FormFields

2010-08-10 Thread Nuno Maltez
Hi,

I think choices in Appengine models does not work in the same way as
in Django models and does not expect a list of tuples in the form
(label, value) but a simple list of values.

See
http://code.google.com/intl/pt-PT/appengine/docs/python/datastore/propertyclass.html#Property
https://code.google.com/intl/pt-PT/appengine/docs/python/datastore/overview.html#Data_Modeling_With_Python
http://code.google.com/p/googleappengine/issues/detail?id=350


Also you for loop seems suspicious:
{% for sexo in sexo_listar value %}

I've don't think this extra value word is valid nor mentioned in the docs:
http://www.djangoproject.com/documentation/0.96/templates/#for

hth,
Nuno


On Mon, Aug 9, 2010 at 9:46 PM, Ipca - Instituto Politécnico Cávado e
Ave IPCA ipca...@gmail.com wrote:
 Hi,
 Need help to implement a form that displays the template´s choices
 from my models.py file.
 When i try to access the handler guardaPerfil, it shows the forms but
 doesn´t fill neither is accesible to select choices created.


 -Here´s my models.py: --
 from google.appengine.ext import db
 from google.appengine.ext.db import djangoforms
 from google.appengine.api import users
 from django import newforms

 ESCOLHA_SEXO = (
                ('M', 'masculino'),
                ('F', 'feminino'),
                )
 ESCOLA =(
        ('EST', 'Escola Superior Tecnologia'),
        ('ESG', 'Escola Superior de Gestao'),
        )

 class Conta(db.Model):
    user=db.UserProperty(u'user', required=True)
    nome=db.StringProperty(u'nome', required=True)
    apelido=db.StringProperty(u'apelido', required=True)
    sexo=db.StringProperty(u'Sexo', required=False, choices =
 ESCOLHA_SEXO)
    email=db.EmailProperty(u'email', required=True)
    escola=db.StringProperty(u'escola', required=False, choices =
 ESCOLA)

 class Utilizador(db.Model):
    user=db.UserProperty(u'user', required=False)
    foto = db.BlobProperty(u'foto')


 --Here´s my
 forms.py:-
 from google.appengine.ext.webapp import template
 from google.appengine.ext.db import djangoforms
 import models

 class ContaForm(djangoforms.ModelForm):
    class Meta:
        model=models.Conta
        exclude = ['user']

 class UtilizadorForm(djangoforms.ModelForm):
    class Meta:
        model=models.Utilizador
        exclude = ['user']

 Here´s my
 Handler:---
 class GuardarPerfilHandler(webapp.RequestHandler):
    def post(self):
        if self.request.get('escolhe_conta'):
            id = int(self.request.get('escolhe_conta'))
            conta = models.Conta.get(db.Key.from_path('Conta', id))
        else:
            conta = models.Conta()

        data = forms.ContaForm(data = self.request.POST)
        if data.is_valid():
            if users.get_current_user():
                conta.user = users.get_current_user()

            conta.nome = self.request.get('nome')
            conta.apelido = self.request.get('apelido')
            conta.sexo = self.request.get('sexo')
            conta.email = self.request.get('email')
            conta.escola = self.request.get('escola')

            conta.put()
            self.redirect('/perfil')
        else:
            path = os.path.join(os.path.dirname(__file__), 'templates/
 guardaPerfil.html')
            self.response.out.write(template.render(path, locals(),
 debug = True))

    def get(self):
        user=users.get_current_user()
        if user:
            greeting=(ullistrongb%s /b/strong|/lilia
 href=\/perfil\ Minha Conta /a|/lilia href=\%s\Logout/a/
 li/ul %(user.nickname(), users.create_logout_url(/)))
        else:
            greeting = (ullia href=\%s\Login/a/li/ul %
 (users.create_login_url(/)))

        contaForm = (form method=\POST\ action=\\table%s/
 tableinput type=\submit\ value=\k\ //form %
 (forms.ContaForm()))

        conta = db.Query(models.Conta)
        conta = conta.filter('user =', user)
        conta_lista = conta.fetch(limit = 1)

        escola_list = models.Conta.escola.choices
        sexo_listar = models.Conta.sexo.choices

        path = os.path.join(os.path.dirname(__file__), 'templates/
 guardaPerfil.html')
        self.response.out.write(template.render(path, locals(),
 debug=True))

 -Here´s my
 tenplate

 tdSexo: /td
                                                td
                                                        {% for sexo in 
 sexo_listar value %}
                                                                {% ifequal 
 escolhe_conta.sexo.sexo sexo.sexo %}
                                                                        
 labelinput type=radio name=escolhe_sexo
 value={{ sexo.sexo }} checked /{{ sexo.sexo }}/label
                                                                {% else %}
                                                                        
 

Re: [google-appengine] Re: bulkuploading to a version

2010-05-04 Thread Nuno Maltez
Well, it directs me to the google accounts login page (the remote_api
url is protected by
login: admin ).

The bulkloader command prompts me for the password, but it still fails with an

[INFO] Authentication Failed

message...

On Thu, Apr 29, 2010 at 9:01 PM, Matthew Blain matthew.bl...@google.com wrote:
 Try visiting what you passed in to --url in the browser. It should say
 This request did not contain a necessary header if everything is
 working correctly.

 On Apr 29, 4:37 am, Nuno Maltez nuno.li...@gmail.com wrote:
 Hi,

 I wonder if this is possible. I have a GAE site that's static, i.e.,
 does not use the datatstore at all. I'm in the process of converting
 it to a dynamic version (using django nonrel), and I was trying to
 deploy the new site to a different version under the same app_id, for
 testing. I have some data in my development datastore that I wanted to
 push to appspot using bulkuploader.

 My app is on a Google Apps domain, but of course my active version
 doesn't have /remote_api enabled, so I wanted to connect to the
 specific version:

 bulkloader.py  --restore --debug --email=nuno@domain.com
 --auth_domain=domain.com --kind=Section
 --url=http://nonrel.latest.appid.appspot.com/remote_api/remote_api
 --filename=../db/Section .

 but this always fails with a

 [INFO    ] Authentication Failed

 message. Is this because I'm using a appspot.com url with a google
 apps auth_domain ? Would it be possible to bulkupload to the active
 version - enabling remote_api - even though the code for my models
 isn't there - and would this problem also emerge if I tried to
 appcfg.py upload/download_data instead of the bulkuploader?

 Thanks in advance,
 Nuno

 --
 You received this message because you are subscribed to the Google Groups 
 Google App Engine group.
 To post to this group, send email to google-appeng...@googlegroups.com.
 To unsubscribe from this group, send email to 
 google-appengine+unsubscr...@googlegroups.com.
 For more options, visit this group 
 athttp://groups.google.com/group/google-appengine?hl=en.

 --
 You received this message because you are subscribed to the Google Groups 
 Google App Engine group.
 To post to this group, send email to google-appeng...@googlegroups.com.
 To unsubscribe from this group, send email to 
 google-appengine+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/google-appengine?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appeng...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.



[google-appengine] bulkuploading to a version

2010-04-29 Thread Nuno Maltez
Hi,

I wonder if this is possible. I have a GAE site that's static, i.e.,
does not use the datatstore at all. I'm in the process of converting
it to a dynamic version (using django nonrel), and I was trying to
deploy the new site to a different version under the same app_id, for
testing. I have some data in my development datastore that I wanted to
push to appspot using bulkuploader.

My app is on a Google Apps domain, but of course my active version
doesn't have /remote_api enabled, so I wanted to connect to the
specific version:

bulkloader.py  --restore --debug --email=nuno@domain.com
--auth_domain=domain.com --kind=Section
--url=http://nonrel.latest.appid.appspot.com/remote_api/remote_api
--filename=../db/Section .

but this always fails with a

[INFO] Authentication Failed

message. Is this because I'm using a appspot.com url with a google
apps auth_domain ? Would it be possible to bulkupload to the active
version - enabling remote_api - even though the code for my models
isn't there - and would this problem also emerge if I tried to
appcfg.py upload/download_data instead of the bulkuploader?

Thanks in advance,
Nuno

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appeng...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.



[google-appengine] Re: SDK 1.1.9 breaks google-app-engine-django?

2009-02-16 Thread Nuno Maltez

On Thu, Feb 12, 2009 at 8:07 PM, Brett C. bcan...@gmail.com wrote:
 On Feb 10, 4:47 am, Nuno Maltez nuno.li...@gmail.com wrote:
 I get the following Warning followed by an Error when I try to access my app:

 WARNING:root:Blocking access to skipped file
 /home/nuno/tmp/work-i18n/.google_appengine/lib/django/django/foo

 That WARNING line is what is causing your trouble. SDK 1.1.9 blocks
 relying on files that will not be uploaded with your application,
 including anything in a directory starting with a dot,
 e.g. .google_appengine. Thus when the Django helper tries to import
 django it gets blocked by dev_appserver since the SDK is living in a
 place that will not be uplaoded with your application.

 The fix should be not use the Django helper's little trick of keeping
 your SDK in .google_appengine but instead actually install it, or at
 least keep it outside of your app directory. That should prevent the
 skipped file blocking from interfering with your imports.

Thanks. I installed the SDK on /usr/local and this particular problem
was solved. I still had to apply the changes made in r72 and r73 in
__init__.py to my version of the helper to stop it from trying to
access app.yaml. Now everything's working with the Django version
included on the SDK.

Nuno

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: SDK 1.1.9 breaks google-app-engine-django?

2009-02-10 Thread Nuno Maltez

Hi,

I have a similar problem, except that I'm using Django 0.96 included
in the SDK and App Engine Helper for Django rev 53 (following the
instructions in the README, it's the latest revision that works with
0.96). Updating to r73 would mean having to update to a more recent
version of Django and include it in my project, which was not in my
plans.

I get the following Warning followed by an Error when I try to access my app:

WARNING:root:Blocking access to skipped file
/home/nuno/tmp/work-i18n/.google_appengine/lib/django/django/foo
ERROR:root:Exception encountered handling request
Traceback (most recent call last):
  File 
/home/nuno/tmp/work-i18n/.google_appengine/google/appengine/tools/dev_appserver.py,
line 2711, in _HandleRequest
base_env_dict=env_dict)
  File 
/home/nuno/tmp/work-i18n/.google_appengine/google/appengine/tools/dev_appserver.py,
line 380, in Dispatch
base_env_dict=base_env_dict)
  File 
/home/nuno/tmp/work-i18n/.google_appengine/google/appengine/tools/dev_appserver.py,
line 1998, in Dispatch
self._module_dict)
  File 
/home/nuno/tmp/work-i18n/.google_appengine/google/appengine/tools/dev_appserver.py,
line 1916, in ExecuteCGI
reset_modules = exec_script(handler_path, cgi_path, hook)
  File 
/home/nuno/tmp/work-i18n/.google_appengine/google/appengine/tools/dev_appserver.py,
line 1812, in ExecuteOrImportScript
exec module_code in script_module.__dict__
  File /home/nuno/tmp/work-i18n/main.py, line 28, in module
from appengine_django import InstallAppengineHelperForDjango
  File 
/home/nuno/tmp/work-i18n/.google_appengine/google/appengine/tools/dev_appserver.py,
line 982, in decorate
return func(self, *args, **kwargs)
  File 
/home/nuno/tmp/work-i18n/.google_appengine/google/appengine/tools/dev_appserver.py,
line 1572, in load_module
return self.FindAndLoadModule(submodule, fullname, search_path)
  File 
/home/nuno/tmp/work-i18n/.google_appengine/google/appengine/tools/dev_appserver.py,
line 982, in decorate
return func(self, *args, **kwargs)
  File 
/home/nuno/tmp/work-i18n/.google_appengine/google/appengine/tools/dev_appserver.py,
line 1480, in FindAndLoadModule
description)
  File 
/home/nuno/tmp/work-i18n/.google_appengine/google/appengine/tools/dev_appserver.py,
line 982, in decorate
return func(self, *args, **kwargs)
  File 
/home/nuno/tmp/work-i18n/.google_appengine/google/appengine/tools/dev_appserver.py,
line 1430, in LoadModuleRestricted
description)
  File /home/nuno/tmp/work-i18n/appengine_django/__init__.py, line
118, in module
from django import VERSION
ImportError: No module named django
INFO:root:GET / HTTP/1.1 500 -


Anyone else with the same problem? Any pointers to what need to be
changed in order to fix this?

I tried the zip from
http://code.google.com/p/google-app-engine-django/ but got the same
error.

thanks,
Nuno

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Adding an application to a Google Apps domain

2009-02-06 Thread Nuno Maltez

Hi,

We're developing a google app engine application and we'd like to
provide a way for the users to easily install the application to their
Google Apps domain (and to the user's own application ID on App
Engine). Something like the Add it now button on the Google Code
Reviews product available in the Solutions Marketplace:

http://www.google.com/enterprise/marketplace/viewListing?productListingId=5143210+12982233047309328439

I searched this discussion group and the web, but I couldn't find any
relevant information. Is this possible for a provider other than
Google Labs? Does google provide an API or solution to make this easy
for a App Engine solution listed on the Marketplace? Has anyone else
tried this?

Thanks in advance,
Nuno

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---