librelist archives

« back to archive

Re: Flask-Admin

Re: Flask-Admin

From:
vivek poddar
Date:
2012-05-29 @ 17:12
Hi,

Hii, I want to use Flask-Admin for my admin interfaces, is it compulsory to
use falsk-sqlalchemy for that. Because I have created my models by using
sqlalchemy module seperately o, how can I add view for my model then?

Thanks in advance!


-- 

         -*- *Vivek Poddar* -*-

 *Technical consultant (OpenERP)*

*Blog:http://vivekimsit.blogspot.in/
*

Re: [flask] Re: Flask-Admin

From:
Serge S. Koval
Date:
2012-05-29 @ 17:39
Hi,

 As long as you use SQLAlchemy declarative models, you don't have to use
Flask-SQLAlchemy.

Example with barebone sqlalchemy.ext.declarative:

    from sqlalchemy import create_engine
    from sqlalchemy.ext.declarative import declarative_base
    from sqlalchemy.orm import scoped_session, sessionmaker

    Base = declarative_base()

    class User(Base):
        __tablename__ = 'user'

        id = Column(Integer, primary_key=True)
        name = Column(Unicode(64))

    # Create SQLA session
    engine = create_engine('sqlite:///dummy.sqlite')
    session = scoped_session(sessionmaker())

    # Flask initialization here
    admin = Admin(app)

    # Pass a session object here. You might want to store it elsewhere.
    admin.add_view(sqlamodel.ModelView(User, session)

Serge.

On Tue, May 29, 2012 at 8:12 PM, vivek poddar <vivekimsit@gmail.com> wrote:

> Hi,
>
> Hii, I want to use Flask-Admin for my admin interfaces, is it compulsory
> to use falsk-sqlalchemy for that. Because I have created my models by using
> sqlalchemy module seperately o, how can I add view for my model then?
>
> Thanks in advance!
>
>
> --
>
>          -*- *Vivek Poddar* -*-
>
>  *Technical consultant (OpenERP)*
>
> *Blog:http://vivekimsit.blogspot.in/
> *
>
>

Re: [flask] Re: Flask-Admin

From:
施德来 delai
Date:
2012-06-05 @ 12:28
I use Flask-admin 1.0 without Flask-Sqlalchemy too, and also do what you
said, not it not work here.

*my code is here:*

    admin = Admin(app)
    from models import User
    from database import db_session
    from flask.ext.admin.contrib import sqlamodel
    admin.add_view(sqlamodel.ModelView(User, db_session))

*Traceback (most recent call last):*
  File "manage.py", line 41, in <module>
    manager.run()
  File

"/Users/arthasshih/virtual_evns/normal/lib/python2.7/site-packages/Flask_Script-0.3.3-py2.7.egg/flaskext/script.py",
line 710, in run
    self.handle(sys.argv[0], command, sys.argv[2:])
  File

"/Users/arthasshih/virtual_evns/normal/lib/python2.7/site-packages/Flask_Script-0.3.3-py2.7.egg/flaskext/script.py",
line 680, in handle
    app = self.create_app(**app_namespace.__dict__)
  File

"/Users/arthasshih/virtual_evns/normal/lib/python2.7/site-packages/Flask_Script-0.3.3-py2.7.egg/flaskext/script.py",
line 455, in create_app
    return self.app(**kwargs)
  File "/Users/arthasshih/flask/happyvs/main_app/core.py", line 48, in
create_app
    admin.add_view(sqlamodel.ModelView(User, db_session))
  File

"/Users/arthasshih/virtual_evns/normal/lib/python2.7/site-packages/Flask_Admin-1.0.0-py2.7.egg/flask_admin/contrib/sqlamodel/view.py",
line 141, in __init__
    super(ModelView, self).__init__(model, name, category, endpoint, url)
  File

"/Users/arthasshih/virtual_evns/normal/lib/python2.7/site-packages/Flask_Admin-1.0.0-py2.7.egg/flask_admin/model/base.py",
line 222, in __init__
    self._refresh_cache()
  File

"/Users/arthasshih/virtual_evns/normal/lib/python2.7/site-packages/Flask_Admin-1.0.0-py2.7.egg/flask_admin/model/base.py",
line 234, in _refresh_cache
    self._create_form_class = self.get_create_form()
  File

"/Users/arthasshih/virtual_evns/normal/lib/python2.7/site-packages/Flask_Admin-1.0.0-py2.7.egg/flask_admin/model/base.py",
line 419, in get_create_form
    return self.get_form()
  File

"/Users/arthasshih/virtual_evns/normal/lib/python2.7/site-packages/Flask_Admin-1.0.0-py2.7.egg/flask_admin/model/base.py",
line 411, in get_form
    return self.scaffold_form()
  File

"/Users/arthasshih/virtual_evns/normal/lib/python2.7/site-packages/Flask_Admin-1.0.0-py2.7.egg/flask_admin/contrib/sqlamodel/view.py",
line 367, in scaffold_form
    converter=form.AdminModelConverter(self))
  File

"/Users/arthasshih/virtual_evns/normal/lib/python2.7/site-packages/WTForms-1.0.1-py2.7.egg/wtforms/ext/sqlalchemy/orm.py",
line 216, in model_form
    field_dict = model_fields(model, only, exclude, field_args, converter)
  File

"/Users/arthasshih/virtual_evns/normal/lib/python2.7/site-packages/WTForms-1.0.1-py2.7.egg/wtforms/ext/sqlalchemy/orm.py",
line 184, in model_fields
    field = converter.convert(model, mapper, prop, field_args.get(name))
  File

"/Users/arthasshih/virtual_evns/normal/lib/python2.7/site-packages/Flask_Admin-1.0.0-py2.7.egg/flask_admin/contrib/sqlamodel/form.py",
line 156, in convert
    kwargs)
  File

"/Users/arthasshih/virtual_evns/normal/lib/python2.7/site-packages/WTForms-1.0.1-py2.7.egg/wtforms/ext/sqlalchemy/orm.py",
line 56, in convert
    if callable_default and callable(callable_default):
  File "build/bdist.macosx-10.6-intel/egg/sqlalchemy/sql/expression.py",
line 1792, in __nonzero__
TypeError: Boolean value of this clause is not defined



On Wed, May 30, 2012 at 1:39 AM, Serge S. Koval <serge.koval@gmail.com>wrote:

> Hi,
>
>  As long as you use SQLAlchemy declarative models, you don't have to use
> Flask-SQLAlchemy.
>
> Example with barebone sqlalchemy.ext.declarative:
>
>     from sqlalchemy import create_engine
>     from sqlalchemy.ext.declarative import declarative_base
>     from sqlalchemy.orm import scoped_session, sessionmaker
>
>     Base = declarative_base()
>
>     class User(Base):
>         __tablename__ = 'user'
>
>         id = Column(Integer, primary_key=True)
>         name = Column(Unicode(64))
>
>     # Create SQLA session
>     engine = create_engine('sqlite:///dummy.sqlite')
>     session = scoped_session(sessionmaker())
>
>     # Flask initialization here
>     admin = Admin(app)
>
>     # Pass a session object here. You might want to store it elsewhere.
>     admin.add_view(sqlamodel.ModelView(User, session)
>
> Serge.
>
>
> On Tue, May 29, 2012 at 8:12 PM, vivek poddar <vivekimsit@gmail.com>wrote:
>
>> Hi,
>>
>> Hii, I want to use Flask-Admin for my admin interfaces, is it compulsory
>> to use falsk-sqlalchemy for that. Because I have created my models by using
>> sqlalchemy module seperately o, how can I add view for my model then?
>>
>> Thanks in advance!
>>
>>
>> --
>>
>>          -*- *Vivek Poddar* -*-
>>
>>  *Technical consultant (OpenERP)*
>>
>> *Blog:http://vivekimsit.blogspot.in/
>> *
>>
>>
>


-- 
Delai Shi 施德来

Re: [flask] Re: Flask-Admin

From:
Serge S. Koval
Date:
2012-06-05 @ 12:58
Hi,

 wtforms does not like your model for whatever reason. It crashes during
form creation.

 If you can post your model, so I can try to reproduce it - it'll help.

Serge.

On Tue, Jun 5, 2012 at 3:28 PM, 施德来 delai <shidelai@gmail.com> wrote:

> I use Flask-admin 1.0 without Flask-Sqlalchemy too, and also do what you
> said, not it not work here.
>
> *my code is here:*
>
>     admin = Admin(app)
>     from models import User
>     from database import db_session
>     from flask.ext.admin.contrib import sqlamodel
>     admin.add_view(sqlamodel.ModelView(User, db_session))
>
> *Traceback (most recent call last):*
>   File "manage.py", line 41, in <module>
>     manager.run()
>   File
> 
"/Users/arthasshih/virtual_evns/normal/lib/python2.7/site-packages/Flask_Script-0.3.3-py2.7.egg/flaskext/script.py",
> line 710, in run
>     self.handle(sys.argv[0], command, sys.argv[2:])
>   File
> 
"/Users/arthasshih/virtual_evns/normal/lib/python2.7/site-packages/Flask_Script-0.3.3-py2.7.egg/flaskext/script.py",
> line 680, in handle
>     app = self.create_app(**app_namespace.__dict__)
>   File
> 
"/Users/arthasshih/virtual_evns/normal/lib/python2.7/site-packages/Flask_Script-0.3.3-py2.7.egg/flaskext/script.py",
> line 455, in create_app
>     return self.app(**kwargs)
>   File "/Users/arthasshih/flask/happyvs/main_app/core.py", line 48, in
> create_app
>     admin.add_view(sqlamodel.ModelView(User, db_session))
>   File
> 
"/Users/arthasshih/virtual_evns/normal/lib/python2.7/site-packages/Flask_Admin-1.0.0-py2.7.egg/flask_admin/contrib/sqlamodel/view.py",
> line 141, in __init__
>     super(ModelView, self).__init__(model, name, category, endpoint, url)
>   File
> 
"/Users/arthasshih/virtual_evns/normal/lib/python2.7/site-packages/Flask_Admin-1.0.0-py2.7.egg/flask_admin/model/base.py",
> line 222, in __init__
>     self._refresh_cache()
>   File
> 
"/Users/arthasshih/virtual_evns/normal/lib/python2.7/site-packages/Flask_Admin-1.0.0-py2.7.egg/flask_admin/model/base.py",
> line 234, in _refresh_cache
>     self._create_form_class = self.get_create_form()
>   File
> 
"/Users/arthasshih/virtual_evns/normal/lib/python2.7/site-packages/Flask_Admin-1.0.0-py2.7.egg/flask_admin/model/base.py",
> line 419, in get_create_form
>     return self.get_form()
>   File
> 
"/Users/arthasshih/virtual_evns/normal/lib/python2.7/site-packages/Flask_Admin-1.0.0-py2.7.egg/flask_admin/model/base.py",
> line 411, in get_form
>     return self.scaffold_form()
>   File
> 
"/Users/arthasshih/virtual_evns/normal/lib/python2.7/site-packages/Flask_Admin-1.0.0-py2.7.egg/flask_admin/contrib/sqlamodel/view.py",
> line 367, in scaffold_form
>     converter=form.AdminModelConverter(self))
>   File
> 
"/Users/arthasshih/virtual_evns/normal/lib/python2.7/site-packages/WTForms-1.0.1-py2.7.egg/wtforms/ext/sqlalchemy/orm.py",
> line 216, in model_form
>     field_dict = model_fields(model, only, exclude, field_args, converter)
>   File
> 
"/Users/arthasshih/virtual_evns/normal/lib/python2.7/site-packages/WTForms-1.0.1-py2.7.egg/wtforms/ext/sqlalchemy/orm.py",
> line 184, in model_fields
>     field = converter.convert(model, mapper, prop, field_args.get(name))
>   File
> 
"/Users/arthasshih/virtual_evns/normal/lib/python2.7/site-packages/Flask_Admin-1.0.0-py2.7.egg/flask_admin/contrib/sqlamodel/form.py",
> line 156, in convert
>     kwargs)
>   File
> 
"/Users/arthasshih/virtual_evns/normal/lib/python2.7/site-packages/WTForms-1.0.1-py2.7.egg/wtforms/ext/sqlalchemy/orm.py",
> line 56, in convert
>     if callable_default and callable(callable_default):
>   File "build/bdist.macosx-10.6-intel/egg/sqlalchemy/sql/expression.py",
> line 1792, in __nonzero__
> TypeError: Boolean value of this clause is not defined
>
>
>
> On Wed, May 30, 2012 at 1:39 AM, Serge S. Koval <serge.koval@gmail.com>wrote:
>
>> Hi,
>>
>>  As long as you use SQLAlchemy declarative models, you don't have to use
>> Flask-SQLAlchemy.
>>
>> Example with barebone sqlalchemy.ext.declarative:
>>
>>     from sqlalchemy import create_engine
>>     from sqlalchemy.ext.declarative import declarative_base
>>     from sqlalchemy.orm import scoped_session, sessionmaker
>>
>>     Base = declarative_base()
>>
>>     class User(Base):
>>         __tablename__ = 'user'
>>
>>         id = Column(Integer, primary_key=True)
>>         name = Column(Unicode(64))
>>
>>     # Create SQLA session
>>     engine = create_engine('sqlite:///dummy.sqlite')
>>     session = scoped_session(sessionmaker())
>>
>>     # Flask initialization here
>>     admin = Admin(app)
>>
>>     # Pass a session object here. You might want to store it elsewhere.
>>     admin.add_view(sqlamodel.ModelView(User, session)
>>
>> Serge.
>>
>>
>> --
> Delai Shi 施德来
>
>
>

Re: [flask] Re: Flask-Admin

From:
施德来 delai
Date:
2012-06-16 @ 10:38
Thanks for your reply! My Model is here:

class User(Base):

    __tablename__ = 'user'

    id = Column(Integer, primary_key=True)
    name = Column(String(80), unique=True, nullable=False)
    _password_hash = Column('password', String(80), nullable=False)
    email = Column(String(40), unique=True, nullable=False)
    email_confirm_code = Column(String(20))
    create_time = Column(DateTime, default=func.now())



    booked_tps = association_proxy("user_book_tp", "tp", creator=lambda
owner_id:TP(owner_id=owner_id))
    liked_tps = association_proxy("user_like_tp", "tp", creator=lambda
owner_id:TP(owner_id=owner_id))
    owned_tps = relationship('TP', backref = 'owner')

    @property
    def password(self):
        return self._password_hash

    @password.setter
    def password(self, password):
        self._password_hash = generate_password_hash(password)

    password = synonym('_password_hash', descriptor=password)

    def check_password(self, password):
        return check_password_hash(self._password_hash, password)

    def __init__(self, name=None, password=None, email=None):
        self.name = name
        self.password = password
        self.email = email
        self.email_confirm_code = gen_random_str(length=20)

    def __repr__(self):
        return self.name

    #: flask-login required
    def is_active(self):
        """
        Inactive accounts may not log in
        """
        return True

    def is_anonymous(self):
        return False

    def is_authenticated(self):
        return True

    def get_id(self):
        return unicode(self.id)


On Tue, Jun 5, 2012 at 8:58 PM, Serge S. Koval <serge.koval@gmail.com>wrote:

> Hi,
>
>  wtforms does not like your model for whatever reason. It crashes during
> form creation.
>
>  If you can post your model, so I can try to reproduce it - it'll help.
>
> Serge.
>
> On Tue, Jun 5, 2012 at 3:28 PM, 施德来 delai <shidelai@gmail.com> wrote:
>
>> I use Flask-admin 1.0 without Flask-Sqlalchemy too, and also do what you
>> said, not it not work here.
>>
>> *my code is here:*
>>
>>     admin = Admin(app)
>>     from models import User
>>     from database import db_session
>>     from flask.ext.admin.contrib import sqlamodel
>>     admin.add_view(sqlamodel.ModelView(User, db_session))
>>
>> *Traceback (most recent call last):*
>>   File "manage.py", line 41, in <module>
>>     manager.run()
>>   File
>> 
"/Users/arthasshih/virtual_evns/normal/lib/python2.7/site-packages/Flask_Script-0.3.3-py2.7.egg/flaskext/script.py",
>> line 710, in run
>>     self.handle(sys.argv[0], command, sys.argv[2:])
>>   File
>> 
"/Users/arthasshih/virtual_evns/normal/lib/python2.7/site-packages/Flask_Script-0.3.3-py2.7.egg/flaskext/script.py",
>> line 680, in handle
>>     app = self.create_app(**app_namespace.__dict__)
>>   File
>> 
"/Users/arthasshih/virtual_evns/normal/lib/python2.7/site-packages/Flask_Script-0.3.3-py2.7.egg/flaskext/script.py",
>> line 455, in create_app
>>     return self.app(**kwargs)
>>   File "/Users/arthasshih/flask/happyvs/main_app/core.py", line 48, in
>> create_app
>>     admin.add_view(sqlamodel.ModelView(User, db_session))
>>   File
>> 
"/Users/arthasshih/virtual_evns/normal/lib/python2.7/site-packages/Flask_Admin-1.0.0-py2.7.egg/flask_admin/contrib/sqlamodel/view.py",
>> line 141, in __init__
>>     super(ModelView, self).__init__(model, name, category, endpoint, url)
>>   File
>> 
"/Users/arthasshih/virtual_evns/normal/lib/python2.7/site-packages/Flask_Admin-1.0.0-py2.7.egg/flask_admin/model/base.py",
>> line 222, in __init__
>>     self._refresh_cache()
>>   File
>> 
"/Users/arthasshih/virtual_evns/normal/lib/python2.7/site-packages/Flask_Admin-1.0.0-py2.7.egg/flask_admin/model/base.py",
>> line 234, in _refresh_cache
>>     self._create_form_class = self.get_create_form()
>>   File
>> 
"/Users/arthasshih/virtual_evns/normal/lib/python2.7/site-packages/Flask_Admin-1.0.0-py2.7.egg/flask_admin/model/base.py",
>> line 419, in get_create_form
>>     return self.get_form()
>>   File
>> 
"/Users/arthasshih/virtual_evns/normal/lib/python2.7/site-packages/Flask_Admin-1.0.0-py2.7.egg/flask_admin/model/base.py",
>> line 411, in get_form
>>     return self.scaffold_form()
>>   File
>> 
"/Users/arthasshih/virtual_evns/normal/lib/python2.7/site-packages/Flask_Admin-1.0.0-py2.7.egg/flask_admin/contrib/sqlamodel/view.py",
>> line 367, in scaffold_form
>>     converter=form.AdminModelConverter(self))
>>   File
>> 
"/Users/arthasshih/virtual_evns/normal/lib/python2.7/site-packages/WTForms-1.0.1-py2.7.egg/wtforms/ext/sqlalchemy/orm.py",
>> line 216, in model_form
>>     field_dict = model_fields(model, only, exclude, field_args, converter)
>>   File
>> 
"/Users/arthasshih/virtual_evns/normal/lib/python2.7/site-packages/WTForms-1.0.1-py2.7.egg/wtforms/ext/sqlalchemy/orm.py",
>> line 184, in model_fields
>>     field = converter.convert(model, mapper, prop, field_args.get(name))
>>   File
>> 
"/Users/arthasshih/virtual_evns/normal/lib/python2.7/site-packages/Flask_Admin-1.0.0-py2.7.egg/flask_admin/contrib/sqlamodel/form.py",
>> line 156, in convert
>>     kwargs)
>>   File
>> 
"/Users/arthasshih/virtual_evns/normal/lib/python2.7/site-packages/WTForms-1.0.1-py2.7.egg/wtforms/ext/sqlalchemy/orm.py",
>> line 56, in convert
>>     if callable_default and callable(callable_default):
>>   File "build/bdist.macosx-10.6-intel/egg/sqlalchemy/sql/expression.py",
>> line 1792, in __nonzero__
>> TypeError: Boolean value of this clause is not defined
>>
>>
>>
>> On Wed, May 30, 2012 at 1:39 AM, Serge S. Koval <serge.koval@gmail.com>wrote:
>>
>>> Hi,
>>>
>>>  As long as you use SQLAlchemy declarative models, you don't have to use
>>> Flask-SQLAlchemy.
>>>
>>> Example with barebone sqlalchemy.ext.declarative:
>>>
>>>     from sqlalchemy import create_engine
>>>     from sqlalchemy.ext.declarative import declarative_base
>>>     from sqlalchemy.orm import scoped_session, sessionmaker
>>>
>>>     Base = declarative_base()
>>>
>>>     class User(Base):
>>>         __tablename__ = 'user'
>>>
>>>         id = Column(Integer, primary_key=True)
>>>         name = Column(Unicode(64))
>>>
>>>     # Create SQLA session
>>>     engine = create_engine('sqlite:///dummy.sqlite')
>>>     session = scoped_session(sessionmaker())
>>>
>>>     # Flask initialization here
>>>     admin = Admin(app)
>>>
>>>     # Pass a session object here. You might want to store it elsewhere.
>>>     admin.add_view(sqlamodel.ModelView(User, session)
>>>
>>> Serge.
>>>
>>>
>>> --
>> Delai Shi 施德来
>>
>>
>>
>


-- 
Delai Shi 施德来

Re: [flask] Re: Flask-Admin

From:
vivek poddar
Date:
2012-05-29 @ 18:22
Thanks,

Now I want to use the Flask-Login for managing the user session. However
the tutorial is quite confusing or rather incomplete. As I told my models
are inherited from base but in tutorial they just say user but they didn't
tell what if user is a model from Base.

Pls, help me understand. Specially login_user(user).

Thanks in advance!

On Tue, May 29, 2012 at 11:09 PM, Serge S. Koval <serge.koval@gmail.com>wrote:

> Hi,
>
>  As long as you use SQLAlchemy declarative models, you don't have to use
> Flask-SQLAlchemy.
>
> Example with barebone sqlalchemy.ext.declarative:
>
>     from sqlalchemy import create_engine
>     from sqlalchemy.ext.declarative import declarative_base
>     from sqlalchemy.orm import scoped_session, sessionmaker
>
>     Base = declarative_base()
>
>     class User(Base):
>         __tablename__ = 'user'
>
>         id = Column(Integer, primary_key=True)
>         name = Column(Unicode(64))
>
>     # Create SQLA session
>     engine = create_engine('sqlite:///dummy.sqlite')
>     session = scoped_session(sessionmaker())
>
>     # Flask initialization here
>     admin = Admin(app)
>
>     # Pass a session object here. You might want to store it elsewhere.
>     admin.add_view(sqlamodel.ModelView(User, session)
>
> Serge.
>
>
> On Tue, May 29, 2012 at 8:12 PM, vivek poddar <vivekimsit@gmail.com>wrote:
>
>> Hi,
>>
>> Hii, I want to use Flask-Admin for my admin interfaces, is it compulsory
>> to use falsk-sqlalchemy for that. Because I have created my models by using
>> sqlalchemy module seperately o, how can I add view for my model then?
>>
>> Thanks in advance!
>>
>>
>> --
>>
>>          -*- *Vivek Poddar* -*-
>>
>>  *Technical consultant (OpenERP)*
>>
>> *Blog:http://vivekimsit.blogspot.in/
>> *
>>
>>
>


-- 

         -*- *Vivek Poddar* -*-

 *Technical consultant (OpenERP)*

*Blog:http://vivekimsit.blogspot.in/
*

Re: [flask] Re: Flask-Admin

From:
Anthony Ford
Date:
2012-05-29 @ 20:38
I have a piece that uses SQLAlchemy (Flask-SQLAlchemy actually) and
Flask-Login. You can check it out at https://github.com/ajford/RGVRSEF. The
relevant parts are within the admin blueprint (
https://github.com/ajford/RGVRSEF/tree/master/RGVRSEF/admin), and in
particular the 
models.py<https://github.com/ajford/RGVRSEF/blob/master/RGVRSEF/admin/models.py>and
auth.py<https://github.com/ajford/RGVRSEF/blob/master/RGVRSEF/admin/auth.py>
files.

I know it's a bit tricky to figure out what's going on with Flask-Login.

Let me know if you need more clarification.

Anthony Ford,
KF5IBN,
Research Assistant,
Center for Advanced Radio Astronomy,
University of Texas at Brownsville
ford.anthonyj@gmail.com



On Tue, May 29, 2012 at 2:22 PM, vivek poddar <vivekimsit@gmail.com> wrote:

> Thanks,
>
> Now I want to use the Flask-Login for managing the user session. However
> the tutorial is quite confusing or rather incomplete. As I told my models
> are inherited from base but in tutorial they just say user but they didn't
> tell what if user is a model from Base.
>
> Pls, help me understand. Specially login_user(user).
>
> Thanks in advance!
>
>
> On Tue, May 29, 2012 at 11:09 PM, Serge S. Koval <serge.koval@gmail.com>wrote:
>
>> Hi,
>>
>>  As long as you use SQLAlchemy declarative models, you don't have to use
>> Flask-SQLAlchemy.
>>
>> Example with barebone sqlalchemy.ext.declarative:
>>
>>     from sqlalchemy import create_engine
>>     from sqlalchemy.ext.declarative import declarative_base
>>     from sqlalchemy.orm import scoped_session, sessionmaker
>>
>>     Base = declarative_base()
>>
>>     class User(Base):
>>         __tablename__ = 'user'
>>
>>         id = Column(Integer, primary_key=True)
>>         name = Column(Unicode(64))
>>
>>     # Create SQLA session
>>     engine = create_engine('sqlite:///dummy.sqlite')
>>     session = scoped_session(sessionmaker())
>>
>>     # Flask initialization here
>>     admin = Admin(app)
>>
>>     # Pass a session object here. You might want to store it elsewhere.
>>     admin.add_view(sqlamodel.ModelView(User, session)
>>
>> Serge.
>>
>>
>> On Tue, May 29, 2012 at 8:12 PM, vivek poddar <vivekimsit@gmail.com>wrote:
>>
>>> Hi,
>>>
>>> Hii, I want to use Flask-Admin for my admin interfaces, is it compulsory
>>> to use falsk-sqlalchemy for that. Because I have created my models by using
>>> sqlalchemy module seperately o, how can I add view for my model then?
>>>
>>> Thanks in advance!
>>>
>>>
>>> --
>>>
>>>          -*- *Vivek Poddar* -*-
>>>
>>>  *Technical consultant (OpenERP)*
>>>
>>> *Blog:http://vivekimsit.blogspot.in/
>>> *
>>>
>>>
>>
>
>
> --
>
>          -*- *Vivek Poddar* -*-
>
>  *Technical consultant (OpenERP)*
>
> *Blog:http://vivekimsit.blogspot.in/
> *
>
>