Stéphane Wirtel avatar Stéphane Wirtel committed dd0c293

[FIX] Add a new function for the login callback

Comments (0)

Files changed (2)

flaskext/openerp.py

 from .rpc import XmlRPCConnector
 from .rpc import Connection
 from .rpc import Object
+from .rpc import Common
 
-__all__ = ['OpenERP', 'get_object', 'get_data_from_record']
+__all__ = ['OpenERP', 'get_object', 'get_data_from_record', 'login']
 
 def get_object(object_name):
     context = {
                                         app.config['OPENERP_DATABASE'])) or None
         )
 
+    def login(self, username, password):
+        return Common(self.connector).login(self.app.config['OPENERP_DATABASE'], username, password)
 
+
 Flask-OpenERP
 -------------
 
+Links
+`````
+
+* `documentation <http://packages.python.org/Flask-OpenERP>`_
+* `development version <http://bitbucket.org/matrixise/flask-openerp/get/tip.gz#egg=Flask-OpenERP-dev>`_
+
 This extension allows to use the OpenERP server with Flask
 
+Example
+```````
+
 #!/usr/bin/env python
 from flask import Flask
 from flaskext.openerp import OpenERP
 
 setup(
     name='Flask-OpenERP',
-    version='0.1',
+    version='0.3',
     url='http://www.wirtel.be/projects/flask-openerp/',
     license='LGPLv2',
     author='Stephane Wirtel',
         'Flask',
     ],
     classifiers=[
+        'Environment :: Web Environment',
         'Intended Audience :: Developers',
         'License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)',
         'Operating System :: OS Independent',
         'Programming Language :: Python',
+        'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
         'Topic :: Software Development :: Libraries :: Python Modules',
     ]
 )
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.