1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/ihatemoney_ynh.git synced 2024-09-03 19:26:15 +02:00

Fix some problems related to postgresql and models

This commit is contained in:
Alexis Metaireau 2011-10-13 21:27:56 +02:00
parent b7ba8e43c4
commit 97132ce88a
6 changed files with 22 additions and 8 deletions

1
.gitignore vendored
View file

@ -1,3 +1,4 @@
budget/budget.db budget/budget.db
budget/memory budget/memory
budget/settings.py
*.pyc *.pyc

View file

@ -12,10 +12,17 @@ To make it run, you just have to do something like::
$ virtualenv venv $ virtualenv venv
$ source venv/bin/activate $ source venv/bin/activate
$ pip install -r requirements.txt $ pip install -r budget/requirements.txt
$ cd budget $ cd budget
$ python run.py $ python run.py
It is also better to actually turn the debugging mode on when you're
developing. You can create a `settings.py` file in the `budget` directory, with
the following content::
DEBUG = True
SQLACHEMY_ECHO = DEBUG
Deploy it Deploy it
========= =========
@ -33,6 +40,9 @@ To deploy it, I'm using gunicorn and supervisord::
Don't forget to set the right permission for your files ! Don't forget to set the right permission for your files !
Also, create a `settings.py` file with the appropriate values if you need to
use a different database for instance.
How to contribute How to contribute
================= =================

View file

@ -1,6 +1,11 @@
DEBUG = True DEBUG = False
SQLALCHEMY_DATABASE_URI = 'sqlite:///budget.db' SQLALCHEMY_DATABASE_URI = 'sqlite:///budget.db'
SQLACHEMY_ECHO = DEBUG SQLACHEMY_ECHO = DEBUG
SECRET_KEY = "tralala" SECRET_KEY = "tralala"
DEFAULT_MAIL_SENDER = ("Budget manager", "budget@notmyidea.org") DEFAULT_MAIL_SENDER = ("Budget manager", "budget@notmyidea.org")
try:
from settings import *
except ImportError:
pass

View file

@ -92,7 +92,7 @@ class Person(db.Model):
_to_serialize = ("id", "name", "activated") _to_serialize = ("id", "name", "activated")
id = db.Column(db.Integer, primary_key=True) id = db.Column(db.Integer, primary_key=True)
project_id = db.Column(db.Integer, db.ForeignKey("project.id")) project_id = db.Column(db.String, db.ForeignKey("project.id"))
bills = db.relationship("Bill", backref="payer") bills = db.relationship("Bill", backref="payer")
name = db.Column(db.UnicodeText) name = db.Column(db.UnicodeText)
@ -163,7 +163,7 @@ class Bill(db.Model):
class Archive(db.Model): class Archive(db.Model):
id = db.Column(db.Integer, primary_key=True) id = db.Column(db.Integer, primary_key=True)
project_id = db.Column(db.Integer, db.ForeignKey("project.id")) project_id = db.Column(db.String, db.ForeignKey("project.id"))
name = db.Column(db.UnicodeText) name = db.Column(db.UnicodeText)
@property @property

View file

@ -1,10 +1,12 @@
from web import main, db, mail from web import main, db, mail
from api import api from api import api
import os
from flask import * from flask import *
app = Flask(__name__) app = Flask(__name__)
app.config.from_object("default_settings") app.config.from_object("default_settings")
app.register_blueprint(main) app.register_blueprint(main)
app.register_blueprint(api) app.register_blueprint(api)

View file

@ -1,4 +0,0 @@
flask
flask-wtf
flask-sqlalchemy
flask-mail