Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replacement for X-editable? #1615

Closed
vincentwhales opened this issue Mar 10, 2018 · 2 comments
Closed

Replacement for X-editable? #1615

vincentwhales opened this issue Mar 10, 2018 · 2 comments

Comments

@vincentwhales
Copy link

It seems like this plugin hasn't had any development for a while. In addition, it doesn't work for Many-to-Many relationship.

Are there other alternatives?

@ljluestc
Copy link


from flask import Flask
from flask_mongoengine import MongoEngine
from flask_mongoengine.wtf import orm

app = Flask(__name__)
app.config['MONGODB_SETTINGS'] = {
    'db': 'your_db_name',
    'host': 'your_mongodb_uri'
}
db = MongoEngine(app)

# Define Author model
class Author(db.Document):
    name = db.StringField(required=True)

# Define Book model
class Book(db.Document):
    title = db.StringField(required=True)
    authors = db.ListField(db.ReferenceField(Author))

# Register Many-to-Many relationship
authorship = db.DynamicDocument.get_collection("authorship")
authorship.insert_one({"Title":"Jurassic Park"," authors":[{"name":" John Doe"},{"name":" Jane Roe"} ])

@davidism davidism closed this as completed Jul 5, 2024
@hasansezertasan
Copy link
Member

I believe the problem with X-Editable remains. It didn't get any updates for a couple of years now and it doesn't support Bootstrap5 and Tabler.

I could recommend HTMX for such a small feature but it'll require some work to be done on the backend.

HTMX could also eliminate some JS scripts used for update, create and detail modals, which will result in less frontend code to maintain.

Flask Admin could also use HTMX for deletions and prevent full page reload after deletion. Here is my take: why reload the list view after deleting a single item instead of removing that item (row) from the HTML table?

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

4 participants