# after all the other imports: from wstuto.ws.types import User , UserRef , UserList # complete the '/ws/user' controller : class UserWSController ( WebServicesController ): @wsexpose ( User ) @wsvalidate ( User ) def create ( self , datas ): """Create a new user. :param datas: The initial datas of the user. The will be ignored. """ pass @wsexpose ( UserList ) @wsvalidate ( int , int ) def list ( self , limit = 20 , offset = 0 ): """List all the users, with pagination. :param limit: How many users should be returned at most. :param offset: From which user should the list start. """ pass @wsexpose ( UserList ) @wsvalidate ( str , str , str , int , int ) def query ( self , user_name = None , email_address = None , display_name = None , limit = 20 , offset = 0 ): """Returns the users having the given values in their datas. The applied operator is "in". :param user_name: If non-null, a string that should be found in the user name. :param email_address: If non-null, a string that should be found in the user email address. :param display_name: If non-null, a string that should be found in the user display name. """ pass @wsexpose ( User ) @wsvalidate ( User ) def update ( self , data ): """Update a user datas and returns its new datas :param data: The new values. null values will be ignored. The id must exist in the database. """ pass @wsexpose () @wsvalidate ( UserRef ) def delete ( self , ref ): """Delete a user. :param ref: An existing user reference. """ pass @wsexpose () @wsvalidate ( UserRef , str , str ) def change_password ( self , ref , old_password , new_password ): """Change a user password. :param ref: The reference of the user. :param old_password: The user old password. :param new_password: The user new password. """ pass @wsexpose () @wsvalidate ( UserRef , str ) def reset_password ( self , ref , password ): """Reset a user password. :param ref: The reference of the user. :param password: The new password. """ pass