Skip to content

Commit

Permalink
Merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
dpgaspar committed Nov 8, 2018
2 parents afe50a3 + 2186b93 commit 7d3e8fb
Show file tree
Hide file tree
Showing 25 changed files with 940 additions and 79 deletions.
27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE.md
@@ -0,0 +1,27 @@
If you'd like to report a bug in Flask-Appbuilder, fill out the template below. Provide
any extra information that may be useful

### Environment

Flask-Appbuilder version:

pip freeze output:

### Describe the expected results

Tell us what should happen.

```python
Paste a minimal example that causes the problem.
```

### Describe the actual results

Tell us what happens instead.

```pytb
Paste the full traceback if there was an exception.
```

### Steps to reproduce

11 changes: 11 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,11 @@

Thank you for contributing to Flask-Appbuilder.

For Fixes:

Please, prefix the title with "Fix, " and describe in detail what you're fixing and the steps required to reproduce the problem.

For new features:

Please, prefix the title with "New, " and describe this new feature in detail, remember to update documentation.

2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -12,3 +12,5 @@ docs/_build/
env
venv
*.sublime*
.vscode/

20 changes: 10 additions & 10 deletions .travis.yml
@@ -1,17 +1,17 @@
language: python
python:
- "3.5"
- "3.3"
- "3.6"
- "2.7"
install:
- "pip install --upgrade 'pip>=9.0.1,<9.99'"
- "pip -V"
- "pip install -r requirements.txt"
- "pip install coveralls"
- "pip install 'mongoengine>=0.7.10,<0.7.99'"
- "pip install 'flask-mongoengine==0.7.1'"
- "pip install 'pymongo>=2.8.1,<2.8.99'"
- "pip install 'Pillow>=3.4.2,<3.99'"
- pip install --upgrade 'pip>=9.0.1,<9.99'
- pip -V
- python setup.py install
- pip install coveralls
- pip install 'mongoengine>=0.7.10,<0.7.99'
- pip install 'flask-mongoengine==0.7.1'
- pip install 'pymongo>=2.8.1,<2.8.99'
- pip install 'Pillow>=3.4.2,<3.99'
- pip install 'mockldap>=0.3.0'
services:
- mongodb
script:
Expand Down
6 changes: 4 additions & 2 deletions Dockerfile
@@ -1,6 +1,8 @@
FROM python:3.5.1

COPY requirements.txt /app/requirements.txt
WORKDIR /app
RUN pip install -r requirements.txt

COPY . .

RUN python setup.py install
RUN pip install coveralls pymongo==2.8 flask-mongoengine==0.7.1 Pillow
19 changes: 13 additions & 6 deletions README.rst
Expand Up @@ -8,7 +8,7 @@ Flask App Builder
.. image:: https://landscape.io/github/dpgaspar/Flask-AppBuilder/master/landscape.svg?style=flat
:target: https://landscape.io/github/dpgaspar/Flask-AppBuilder/master
:alt: Code Health
.. image:: https://img.shields.io/badge/pyversions-2.7%2C3.3%2C3.5-blue.svg
.. image:: https://img.shields.io/badge/pyversions-2.7%2C3.6-blue.svg

Simple and rapid application development framework, built on top of `Flask <http://flask.pocoo.org/>`_.
includes detailed security, auto CRUD generation for your models, google charts and much more.
Expand All @@ -24,7 +24,7 @@ Lots of `examples <https://github.com/dpgaspar/Flask-AppBuilder/tree/master/exam
Package Version
---------------

*New 1.12.0*.
*New 1.12.2*.

BREAKING CHANGES relative to 1.12.0: we have bumped flask-login version, this causes breaking changes on the API relative to this package.

Expand Down Expand Up @@ -60,13 +60,20 @@ Or, if you have mongodb and the requirements installed locally-
`setup.py test`


Projects using FAB
------------------
Projects/Organizations using FAB
--------------------------------

If you would like to share your projects and join the list, just send me the link.
If you would like to share your project, or let everyone know that you're using FAB on your organization please submit a PR or send me an email with the details.

Projects:

- `Superset <https://github.com/airbnb/superset>`_ - a data exploration platform designed to be visual, intuitive, and interactive
- `Flog <http://demo-ninmesara.rhcloud.com/category/about>`_

Organizations:

- Airbnb
- Miniclip
- EuroBIC

Includes:
---------
Expand Down
16 changes: 15 additions & 1 deletion docs/config.rst
Expand Up @@ -49,6 +49,20 @@ Use config.py to configure the following parameters. By default it will use SQLL
+-----------------------------------+--------------------------------------------+-----------+
| AUTH_LDAP_BIND_PASSWORD | Define password for the bind user. | No |
+-----------------------------------+--------------------------------------------+-----------+
| AUTH_LDAP_TLS_DEMAND | Demands TLS peer certificate checking | No |
| | (Bool) | |
+-----------------------------------+--------------------------------------------+-----------+
| AUTH_LDAP_TLS_CACERTDIR | CA Certificate directory to check peer | No |
| | certificate | |
+-----------------------------------+--------------------------------------------+-----------+
| AUTH_LDAP_TLS_CACERTFILE | CA Certificate file to check peer | No |
| | certificate | |
+-----------------------------------+--------------------------------------------+-----------+
| AUTH_LDAP_TLS_CERTFILE | Certificate file for client auth | No |
| | use with AUTH_LDAP_TLS_KEYFILE | |
+-----------------------------------+--------------------------------------------+-----------+
| AUTH_LDAP_TLS_KEYFILE | Certificate key file for client aut | No |
+-----------------------------------+--------------------------------------------+-----------+
| AUTH_LDAP_SEARCH | Use search with self user | No |
| | registration or when using | |
| | AUTH_LDAP_BIND_USER. | |
Expand Down Expand Up @@ -117,7 +131,7 @@ Use config.py to configure the following parameters. By default it will use SQLL
| | AUTH_LDAP_EMAIL_FIELD = "mail" | |
+-----------------------------------+--------------------------------------------+-----------+
| AUTH_LDAP_ALLOW_SELF_SIGNED | Allow LDAP authentication to use self | No |
| | signed certificates | |
| | signed certificates (LDAPS) | |
+-----------------------------------+--------------------------------------------+-----------+
| AUTH_LDAP_APPEND_DOMAIN | Append a domain to all logins. No need to | No |
| | use john@domain.local. Set it like: | |
Expand Down
1 change: 1 addition & 0 deletions docs/i18n.rst
Expand Up @@ -15,6 +15,7 @@ F.A.B. has support for seven languages (planning for some more):
- Portuguese Brazil
- Russian
- Spanish
- Greek

This means that all messages, builtin on the framework are translated to these languages.

Expand Down
12 changes: 1 addition & 11 deletions docs/installation.rst
Expand Up @@ -134,14 +134,4 @@ or::
Python 2 and 3 Compatibility
----------------------------

The framework itself is compatible and has been tested for Python 2.7 and 3.3.
But there is still one problem in Python 3.3, the framework internationalization feature
uses the excellent package Babel, but i've found an incompatibility on it for python 3.3.
While this problem is not solved there is a limitation for Py3.3 on F.A.B. you can't use
Babel's features, so on config you must only setup english::

BABEL_DEFAULT_LOCALE = 'en'
BABEL_DEFAULT_FOLDER = 'translations'
LANGUAGES = {
'en':{'flag':'gb','name':'English'}
}
The framework itself is compatible and has been tested for Python 2.7 and 3.6.
15 changes: 15 additions & 0 deletions docs/versions.rst
@@ -1,6 +1,21 @@
Versions
========

Improvements and Bug fixes on 1.12.2
------------------------------------

- Fix, #832 don't install examples as a package with flask-appbuilder
- Fix, #760 Select all checkbox, in related view, selects checkboxes from all related views
- New, #833 LDAPS TLS config options
- New, #829 Aditional filtering in LDAP search

Improvements and Bug fixes on 1.12.1
------------------------------------

- New, #826 Greek support i18n
- New, #813 Dependencies unpinned
- Fix, #828 list and form widget rendering html InLine, regression from #797

Improvements and Bug fixes on 1.12.0
------------------------------------

Expand Down
2 changes: 0 additions & 2 deletions examples/__init__.py

This file was deleted.

1 change: 1 addition & 0 deletions examples/quickhowto/config.py
Expand Up @@ -30,6 +30,7 @@
'zh': {'flag': 'cn', 'name': 'Chinese'},
'ru': {'flag': 'ru', 'name': 'Russian'},
'pl': {'flag': 'pl', 'name': 'Polish'},
'el': {'flag': 'gr', 'name': 'Greek'},
'ja_JP': {'flag': 'jp', 'name': 'Japanese'}
}

Expand Down
7 changes: 6 additions & 1 deletion flask_appbuilder/baseviews.py
@@ -1,3 +1,4 @@
from inspect import isclass
import json
import logging
from datetime import datetime, date
Expand Down Expand Up @@ -738,7 +739,11 @@ def _get_related_view_widget(self, item, related_view,
filters.add_filter_related_view(fk, self.datamodel.FilterRelationManyToManyEqual,
self.datamodel.get_pk_value(item))
else:
log.error("Can't find relation on related view {0}".format(related_view.name))
if isclass(related_view) and issubclass(related_view, BaseView):
name = related_view.__name__
else:
name = related_view.__class__.__name__
log.error("Can't find relation on related view {0}".format(name))
return None
return related_view._get_view_widget(filters=filters,
order_column=order_column,
Expand Down
8 changes: 4 additions & 4 deletions flask_appbuilder/fieldwidgets.py
Expand Up @@ -11,7 +11,7 @@ class DatePickerWidget(object):
data_template = ('<div class="input-group date appbuilder_date" id="datepicker">'
'<span class="input-group-addon"><i class="fa fa-calendar cursor-hand"></i>'
'</span>'
'<input class="form-control" data-format="yyyy-MM-dd" %(text)s/>'
'<input class="form-control" data-format="yyyy-MM-dd" %(text)s />'
'</div>'
)

Expand All @@ -36,7 +36,7 @@ class DateTimePickerWidget(object):
data_template = ('<div class="input-group date appbuilder_datetime" id="datetimepicker">'
'<span class="input-group-addon"><i class="fa fa-calendar cursor-hand"></i>'
'</span>'
'<input class="form-control" data-format="yyyy-MM-dd hh:mm:ss" %(text)s/>'
'<input class="form-control" data-format="yyyy-MM-dd hh:mm:ss" %(text)s />'
'</div>'
)

Expand Down Expand Up @@ -81,7 +81,7 @@ def __call__(self, field, **kwargs):


class Select2AJAXWidget(object):
data_template = ('<input %(text)s"></input>')
data_template = ('<input %(text)s />')

def __init__(self, endpoint, extra_classes=None, style=None):
self.endpoint = endpoint
Expand All @@ -108,7 +108,7 @@ def __call__(self, field, **kwargs):


class Select2SlaveAJAXWidget(object):
data_template = ('<input class="input-group my_select2_ajax_slave" %(text)s"></input>')
data_template = ('<input class="input-group my_select2_ajax_slave" %(text)s />')

def __init__(self, master_id, endpoint, extra_classes=None, style=None):
self.endpoint = endpoint
Expand Down
7 changes: 3 additions & 4 deletions flask_appbuilder/models/sqla/__init__.py
Expand Up @@ -2,7 +2,7 @@
import re
import datetime
from sqlalchemy.ext.declarative import declarative_base
from flask_sqlalchemy import SQLAlchemy, _BoundDeclarativeMeta, _QueryProperty
from flask_sqlalchemy import SQLAlchemy, DefaultMeta, _QueryProperty

try:
from sqlalchemy.ext.declarative import as_declarative
Expand Down Expand Up @@ -30,8 +30,7 @@ class SQLA(SQLAlchemy):
Use it and configure it just like flask_SQLAlchemy
"""
def make_declarative_base(self, metadata=None):
"""Creates the declarative base."""
def make_declarative_base(self, model, metadata=None):
base = Model
base.query = _QueryProperty(self)
return base
Expand All @@ -46,7 +45,7 @@ def get_tables_for_bind(self, bind=None):
return result


class ModelDeclarativeMeta(_BoundDeclarativeMeta):
class ModelDeclarativeMeta(DefaultMeta):
"""
Base Model declarative meta for all Models definitions.
Setups bind_keys to support multiple databases.
Expand Down

0 comments on commit 7d3e8fb

Please sign in to comment.