Error on incoming custom type parameter

Asked by oyzzo

I am trying to create a service with a custom type called User and a couple of methods one of them accepting an User as incoming parameter, the code is here: http://pastebin.com/X0pA19rg but it's not working, i get a syntax error when i try to access it with the browser:

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/ladon-0.6.3-py2.7.egg/ladon/server/wsgi_application.py", line 292, in __call__
    self.import_services(self.service_list)
  File "/usr/local/lib/python2.7/dist-packages/ladon-0.6.3-py2.7.egg/ladon/server/wsgi_application.py", line 248, in import_services
    __import__(service)
  File "/var/www/wsgi/userservices/userservices.py", line 33
    def createUser(self, u=User)
                                               ^
SyntaxError: invalid syntax

Question information

Language:
English Edit question
Status:
Solved
For:
ladon Edit question
Assignee:
No assignee Edit question
Solved by:
oyzzo
Solved:
Last query:
Last reply:
Revision history for this message
azurit (azurit) said :
#1

cos it is a syntax error :) just use 'u' and not 'u=User'

Revision history for this message
oyzzo (oyzzoforfree) said :
#2

with User i just specify the type of the parameter, so i don't think it's incorrect but anyway without it it keeps giving me the same error:

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/ladon-0.6.3-py2.7.egg/ladon/server/wsgi_application.py", line 292, in __call__
    self.import_services(self.service_list)
  File "/usr/local/lib/python2.7/dist-packages/ladon-0.6.3-py2.7.egg/ladon/server/wsgi_application.py", line 248, in import_services
    __import__(service)
  File "/var/www/wsgi/userservices/userservices.py", line 33
    def createUser(self, u)
                                            ^
SyntaxError: invalid syntax

Revision history for this message
oyzzo (oyzzoforfree) said :
#3

Hahaha i found the error, it was a much more silly one, i forgot the ":" after defining the method!
sorry for that! It's my first project in python... i'm used to c/c++ :P