Skip to content

Commit

Permalink
Merge pull request #2493 from pallets-eco/remove-flask-mongoengine
Browse files Browse the repository at this point in the history
Remove (flask-)mongoengine support :(
  • Loading branch information
samuelhwilliams authored Aug 6, 2024
2 parents b8a2e5d + ef0cd58 commit 960550e
Show file tree
Hide file tree
Showing 68 changed files with 25 additions and 4,160 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ jobs:
tox: 'py38-min'
- python: '3.12'
tox: 'py312-noflaskbabel'
- python: '3.12'
tox: 'py312-flaskmongoengine-sqlalchemy1'
- python: '3.8'
tox: 'py38-sqlalchemy1'
- python: '3.12'
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ application.
Out-of-the-box, Flask-Admin plays nicely with various ORM\'s, including

- [SQLAlchemy](http://www.sqlalchemy.org/)
- [MongoEngine](http://mongoengine.org/)
- [pymongo](http://api.mongodb.org/python/current/)
- and [Peewee](https://github.com/coleifer/peewee).

Expand All @@ -51,7 +50,7 @@ add your own, or improve on the existing examples, and submit a

To run the examples in your local environment:
1. Clone the repository:

```bash
git clone https://github.com/pallets-eco/flask-admin.git
cd flask-admin
Expand All @@ -62,7 +61,7 @@ To run the examples in your local environment:
# Windows:
python -m venv .venv
.venv\Scripts\activate
# Linux:
python3 -m venv .venv
source .venv/bin/activate
Expand Down
20 changes: 0 additions & 20 deletions babel/admin.pot
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ msgid "Editing %(path)s"
msgstr ""

#: ../flask_admin/contrib/fileadmin/__init__.py:1163
#: ../flask_admin/contrib/mongoengine/view.py:658
#: ../flask_admin/contrib/peewee/view.py:487
#: ../flask_admin/contrib/pymongo/view.py:384
#: ../flask_admin/contrib/sqla/view.py:1149
Expand All @@ -224,67 +223,57 @@ msgstr ""
msgid "Cannot operate on non empty directories"
msgstr ""

#: ../flask_admin/contrib/mongoengine/filters.py:39
#: ../flask_admin/contrib/peewee/filters.py:35
#: ../flask_admin/contrib/pymongo/filters.py:38
#: ../flask_admin/contrib/sqla/filters.py:41
msgid "equals"
msgstr ""

#: ../flask_admin/contrib/mongoengine/filters.py:48
#: ../flask_admin/contrib/peewee/filters.py:43
#: ../flask_admin/contrib/pymongo/filters.py:47
#: ../flask_admin/contrib/sqla/filters.py:49
msgid "not equal"
msgstr ""

#: ../flask_admin/contrib/mongoengine/filters.py:58
#: ../flask_admin/contrib/peewee/filters.py:52
#: ../flask_admin/contrib/pymongo/filters.py:57
#: ../flask_admin/contrib/sqla/filters.py:58
msgid "contains"
msgstr ""

#: ../flask_admin/contrib/mongoengine/filters.py:68
#: ../flask_admin/contrib/peewee/filters.py:61
#: ../flask_admin/contrib/pymongo/filters.py:67
#: ../flask_admin/contrib/sqla/filters.py:67
msgid "not contains"
msgstr ""

#: ../flask_admin/contrib/mongoengine/filters.py:77
#: ../flask_admin/contrib/peewee/filters.py:69
#: ../flask_admin/contrib/pymongo/filters.py:80
#: ../flask_admin/contrib/sqla/filters.py:75
msgid "greater than"
msgstr ""

#: ../flask_admin/contrib/mongoengine/filters.py:86
#: ../flask_admin/contrib/peewee/filters.py:77
#: ../flask_admin/contrib/pymongo/filters.py:93
#: ../flask_admin/contrib/sqla/filters.py:83
msgid "smaller than"
msgstr ""

#: ../flask_admin/contrib/mongoengine/filters.py:98
#: ../flask_admin/contrib/peewee/filters.py:88
#: ../flask_admin/contrib/sqla/filters.py:94
msgid "empty"
msgstr ""

#: ../flask_admin/contrib/mongoengine/filters.py:113
#: ../flask_admin/contrib/peewee/filters.py:102
#: ../flask_admin/contrib/sqla/filters.py:108
msgid "in list"
msgstr ""

#: ../flask_admin/contrib/mongoengine/filters.py:122
#: ../flask_admin/contrib/peewee/filters.py:111
#: ../flask_admin/contrib/sqla/filters.py:118
msgid "not in list"
msgstr ""

#: ../flask_admin/contrib/mongoengine/filters.py:222
#: ../flask_admin/contrib/peewee/filters.py:207
#: ../flask_admin/contrib/peewee/filters.py:244
#: ../flask_admin/contrib/peewee/filters.py:281
Expand All @@ -294,24 +283,20 @@ msgstr ""
msgid "not between"
msgstr ""

#: ../flask_admin/contrib/mongoengine/filters.py:247
msgid "ObjectId equals"
msgstr ""

#: ../flask_admin/contrib/mongoengine/view.py:551
#, python-format
msgid "Failed to get model. %(error)s"
msgstr ""

#: ../flask_admin/contrib/mongoengine/view.py:570
#: ../flask_admin/contrib/peewee/view.py:435
#: ../flask_admin/contrib/pymongo/view.py:316
#: ../flask_admin/contrib/sqla/view.py:1078
#, python-format
msgid "Failed to create record. %(error)s"
msgstr ""

#: ../flask_admin/contrib/mongoengine/view.py:596
#: ../flask_admin/contrib/peewee/view.py:454
#: ../flask_admin/contrib/pymongo/view.py:341
#: ../flask_admin/contrib/sqla/view.py:1104 ../flask_admin/model/base.py:2305
Expand All @@ -320,22 +305,19 @@ msgstr ""
msgid "Failed to update record. %(error)s"
msgstr ""

#: ../flask_admin/contrib/mongoengine/view.py:619
#: ../flask_admin/contrib/peewee/view.py:469
#: ../flask_admin/contrib/pymongo/view.py:366
#: ../flask_admin/contrib/sqla/view.py:1129
#, python-format
msgid "Failed to delete record. %(error)s"
msgstr ""

#: ../flask_admin/contrib/mongoengine/view.py:659
#: ../flask_admin/contrib/peewee/view.py:488
#: ../flask_admin/contrib/pymongo/view.py:385
#: ../flask_admin/contrib/sqla/view.py:1150
msgid "Are you sure you want to delete selected records?"
msgstr ""

#: ../flask_admin/contrib/mongoengine/view.py:668
#: ../flask_admin/contrib/peewee/view.py:505
#: ../flask_admin/contrib/pymongo/view.py:395
#: ../flask_admin/contrib/sqla/view.py:1166 ../flask_admin/model/base.py:2118
Expand All @@ -345,7 +327,6 @@ msgid_plural "%(count)s records were successfully deleted."
msgstr[0] ""
msgstr[1] ""

#: ../flask_admin/contrib/mongoengine/view.py:674
#: ../flask_admin/contrib/peewee/view.py:511
#: ../flask_admin/contrib/pymongo/view.py:400
#: ../flask_admin/contrib/sqla/view.py:1174
Expand Down Expand Up @@ -659,4 +640,3 @@ msgstr ""
#: ../flask_admin/templates/bootstrap3/admin/model/row_actions.html:34
msgid "Are you sure you want to delete this record?"
msgstr ""

34 changes: 1 addition & 33 deletions doc/advanced.rst
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,6 @@ installed if you need to do any processing on the image files.
Have a look at the example at
https://github.com/flask-admin/Flask-Admin/tree/master/examples/forms-files-images.

If you are using the MongoEngine backend, Flask-Admin supports GridFS-backed image and file uploads through WTForms fields. Documentation can be found at :mod:`flask_admin.contrib.mongoengine.fields`.

If you just want to manage static files in a directory, without tying them to a database model, then
use the :ref:`File-Admin<file-admin>` plug-in.

Expand Down Expand Up @@ -469,36 +467,6 @@ a model that violates a unique-constraint leads to an Sqlalchemy-Integrity-Error
a proper error message and you can change the data in the form. When the application has been started with ``debug=True``
the ``werkzeug`` debugger will catch the exception and will display the stacktrace.

MongoEngine
***********

If you're looking for something simpler than SQLAlchemy, and your data models
are reasonably self-contained, then `MongoDB <https://www.mongodb.org/>`_, a popular *NoSQL* database,
could be a better option.

`MongoEngine <http://mongoengine.org/>`_ is a python wrapper for MongoDB.
For an example of using MongoEngine with Flask-Admin, see
https://github.com/flask-admin/flask-admin/tree/master/examples/mongoengine.


Features:

- MongoEngine 0.7+ support
- Paging, sorting, filters, etc
- Supports complex document structure (lists, subdocuments and so on)
- GridFS support for file and image uploads

In order to use MongoEngine integration, install the
`Flask-MongoEngine <https://flask-mongoengine.readthedocs.io>`_ package.
Flask-Admin uses form scaffolding from it.

Known issues:

- Search functionality can't split query into multiple terms due to
MongoEngine query language limitations

For more, check the :class:`~flask_admin.contrib.mongoengine` API documentation.

Peewee
******

Expand Down Expand Up @@ -577,7 +545,7 @@ though it is easy to get started with a simple `CRUD <http://en.wikipedia.org/wi
interface for each model in your application, Flask-Admin doesn't fix you to this approach, and you are free to
define other ways of interacting with some, or all, of your models.

Due to Flask-Admin supporting more than one ORM (SQLAlchemy, MongoEngine, Peewee, raw pymongo), the developer is even
Due to Flask-Admin supporting more than one ORM (SQLAlchemy, Peewee, raw pymongo), the developer is even
free to mix different model types into one application by instantiating appropriate CRUD classes.

Here is a list of some of the configuration properties that are made available by Flask-Admin and the
Expand Down
2 changes: 0 additions & 2 deletions doc/api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ API

mod_contrib_sqla
mod_contrib_sqla_fields
mod_contrib_mongoengine
mod_contrib_mongoengine_fields
mod_contrib_peewee
mod_contrib_pymongo
mod_contrib_fileadmin
Expand Down
22 changes: 0 additions & 22 deletions doc/api/mod_contrib_mongoengine.rst

This file was deleted.

13 changes: 0 additions & 13 deletions doc/api/mod_contrib_mongoengine_fields.rst

This file was deleted.

1 change: 0 additions & 1 deletion doc/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ Extra name What functionality does this add to Flask-Admin?
sqlalchemy SQLAlchemy, for accessing many database engines
sqlalchemy-with-utils As above, with some additional utilities for different data types
geoalchemy As with SQLAlchemy, but adding support for geographic data and maps
mongoengine Supports the Flask-Mongoengine library
pymongo Supports the PyMongo library
peewee Supports the peewee library
s3 Supports file admin using AWS S3
Expand Down
23 changes: 0 additions & 23 deletions examples/auth-mongoengine/README.rst

This file was deleted.

Loading

0 comments on commit 960550e

Please sign in to comment.