Giter Club home page Giter Club logo

flask-admin's People

Contributors

abkfenris avatar artemserga avatar bryhoyt avatar cosmius avatar ctoth avatar datran avatar david-e avatar dmedvinsky avatar gstf avatar italomaia avatar iurisilvio avatar jacobsvante avatar lanybass avatar longhotsummer avatar manuelbua avatar mikelambert avatar mrjoes avatar pawl avatar petrus-jvrensburg avatar plaes avatar radioprotector avatar raz0r avatar silme-ea avatar singingwolfboy avatar sumpfgottheit avatar techniq avatar torotil avatar vtomy avatar wilsaj avatar yefim avatar

Watchers

 avatar

flask-admin's Issues

Add support for SQAlchemy Enum field

If you have code::

class Category(Model):
    status = Column(Enum('category_status1', 'category_status2'), name='statuses')

class Product(Model):
    status = Column(Enum('status1', 'status2'), name='statuses')
    category_id = Column(ForeignKey(Category.id))
    category = relationship(Category)

class ProductView(ModelView):
    column_labels = form_labels = {
         'status': u'Статус продукта',
         'category.status': u'Статус категории',
    }
    column_choices = form_choices = {
        'status': [
             ('status1', u'Статус продукта 1'), 
             ('status2', u'Статус продукта 2'), 
        ],
        'category.status': [
             ('category_status1', u'Статус категории 1'), 
             ('category_status2', u'Статус категории 2'), 
        ],
    }
    column_filters = [
        'status',
        'category.status',
    ]

then you will have automatically:

  1. Correct and readable SelectField for status field
  2. Readable values in table for columns status, category.status
  3. Choice filters

Remove ModelView.column_hide_backrefs

I think using ModelView.column_hide_backrefs is confusing, cause it is hard to understand how to make ONETOMANY relation works in form

  1. By default ModelView.column_hide_backrefs = True, so if you have form_columns=['products'] (i.e. products is ONETOMANY for category) it does't work untill you add ModelView.column_hide_backrefs = False
  2. If someone wants to disable ONETOMANY he just shouldn't pass products to form_columns. It's more obvious way.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.