def create_post_by_user(): john = User(email='*****@*****.**') john.first_name = 'john' john.last_name = 'Lawley' john.save() post1 = TextPost(title='Fun with MongoEngine', author=john) post1.content = 'Took a look at MongoEngine today, looks pretty cool.' post1.tags = ['mongodb', 'mongoengine'] post1.save() post2 = LinkPost(title='MongoEngine Documentation', author=john) post2.link_url = 'http://docs.mongoengine.com/' post2.tags = ['mongoengine'] post2.save()