Questions tagged [flask-mongoengine]

Flask-MongoEngine is a Flask extension that provides integration with MongoEngine.

Flask-MongoEngine is a Flask extension that provides integration with MongoEngine.

232 questions
14
votes
1 answer

MongoEngine: storing EmbeddedDocument in DictField

I'm modelling a MongoDB database in MongoEngine for a web project. I want to store the data in a slightly unusual way to be able to efficiently query it later. Our data in MongoDB looks something like this: // "outer" { "outer_data":…
robinandeer
  • 491
  • 1
  • 5
  • 12
14
votes
2 answers

Flask-MongoEngine & PyMongo Aggregation Query

I am trying to make an aggregation query using flask-mongoengine, and from what I have read it does not sound like it is possible. I have looked over several forum threads, e-mail chains and a few questions on Stack Overflow, but I have not found a…
10
votes
1 answer

Python / Flask / MongoEngine DateTimeField

First of I'm new to python and flask. I've searched around and tried something things to no avail. I have a model that has a DateTimeField as one of the members, let's call it "created_at". When I go to return the query set as JSON I see this for…
KMLong
  • 8,345
  • 2
  • 16
  • 19
10
votes
3 answers

MongoEngine Document Object made using from_json doesn't save

I am trying to build a document object using from_json method. object.save() throws no error, but the document is not inserted in mongo. On the other hand if I make the object by assigning values to each of the fields, it works fine. I am unable to…
BabbarTushar
  • 1,285
  • 2
  • 11
  • 20
9
votes
1 answer

How can I connect a mongodb replicaset using mongoengine?

I'm trying to connect to a MongoDB replicaSet using MongoEngine? I would like to connect to any available secondary server. I can only find pyMongo examples. Any help?
rat
  • 1,277
  • 16
  • 24
9
votes
1 answer

Embedded Documents issue with MongoEngine

I am using MongoDB with Flask-MongoEngine as my ORM component to my web app. I have structured the User document schema like so: from ..core import db class UserComics(db.EmbeddedDocument): favorites = db.SortedListField(db.StringField(),…
Tim Bueno
  • 401
  • 2
  • 5
  • 11
8
votes
1 answer

error while following Tumblelog Application with Flask and MongoEngine

I am following tumbleblog application here my __init__.py: from flask import Flask from flask.ext.mongoengine import MongoEngine app = Flask(__name__) app.config["MONGODB_SETTINGS"] = {'DB': "sencha_web_service", 'username': "",…
Nidhin Bose J.
  • 1,092
  • 15
  • 28
7
votes
1 answer

Trouble rendering listfield model_form on mongoengine

I am using Flask, mongoengine for a project and I am trying to get basic stuff working from http://docs.mongodb.org/manual/tutorial/write-a-tumblelog-application-with-flask-mongoengine/ After implementing everything from above link I added a new…
user1695285
  • 259
  • 2
  • 5
  • 10
6
votes
2 answers

Switching Collections and saving in Flask-Mongoengine

I am having trouble saving documents to a new collection and then deleting them from the old one. I create a new object like so: class Test(mongo.Document): field = mongo.StringField() t =…
austin_ce
  • 1,063
  • 15
  • 28
5
votes
2 answers

MongoClient opened before fork. Create MongoClient only Flask

I am running Flask with uwsgi threaded mode with processes 4 and using pymongo also flask_mongoengine and uwsgi says "MongoClient opened before fork. Create MongoClient only " I tried connect with connect=False but the result is same lazy-apps =…
Beqa Bukhradze
  • 409
  • 4
  • 16
5
votes
1 answer

MongoDB: Reference another document with additional info attached

I have a situation where I have a type of group document. I want to have a list field that contains a reference Id to the users in the group. I need to however indicate which users have admin access. Should I have two lists, one of regular users…
Jhorra
  • 6,233
  • 21
  • 69
  • 123
5
votes
1 answer

Mongoengine query set to list conversion

As in django with sql backend we can convert a queryset into flat list by foovar.objects.all().values_list('id', flat=true) give a list of ids How to get list of ids in mongo backend ,ORM being used is mongoengine in which values_list function has…
5
votes
2 answers

Errors NotRegistered flask-mongoengine Tutorial

I started this Turial, Here And get this error **mongoengine.errors.NotRegistered:** `Comment` has not been registered in the document registry. Importing the document class automatically registers it, has it been imported? any idea. Thank you So…
juvasquezg
  • 117
  • 2
  • 11
5
votes
3 answers

Mongoengine, Flask and ReferenceField in WTForms

Hy everybody, I'm realizing a Flask/MongoDB project and since I am new to this world, I've followed the tutorial at this page: http://docs.mongodb.org/ecosystem/tutorial/write-a-tumblelog-application-with-flask-mongoengine/ After that, I've started…
Mattia Galati
  • 2,415
  • 16
  • 22
4
votes
1 answer

How to implement Flask-RBAC for mongoengine Document?

I have an existing project where I have built my models with mongoengine Documents. Now I want to implement role based access control in my project. I want to use flask-rbac with my User model, which currently looks like this: class User(Document): …
Proteeti Prova
  • 1,079
  • 4
  • 25
  • 49
1
2 3
15 16