Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5645de0
commit 88effa0
Showing
4 changed files
with
16 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
https://github.com/mitsuhiko/flask/tarball/master | ||
dataset | ||
flask-mongoengine | ||
nose | ||
Flask-Bootstrap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,3 @@ | ||
# coding: utf-8 | ||
from os import path | ||
from flask import current_app | ||
import dataset | ||
|
||
def get_table(tablename): | ||
database_name = current_app.config['DATABASE_NAME'] | ||
database_path = path.join(current_app.instance_path, database_name) | ||
db = dataset.connect('sqlite:///{0}'.format(database_path)) | ||
return db[tablename] | ||
from flask_mongoengine import MongoEngine | ||
db = MongoEngine() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# coding: utf-8 | ||
from .db import db | ||
|
||
|
||
class Noticia(db.Document): | ||
titulo = db.StringField() | ||
texto = db.StringField() | ||
imagem = db.StringField() |