Compare commits

..

No commits in common. 'master' and 'autogenerate_flutter' have entirely different histories.

  1. 25
      docker-compose-dev.yaml
  2. 1
      main.py
  3. 15
      models/Account.py
  4. 36
      models/Group.py
  5. 17
      models/Payment.py

@ -3,8 +3,9 @@ version: "3"
services:
mongo:
image: mongo
env_file:
.env
environment:
MONGO_INITDB_ROOT_USERNAME: xcoder
MONGO_INITDB_ROOT_PASSWORD: 4dun4710
volumes:
- mongo_data:/data/db/
@ -12,22 +13,22 @@ services:
image: mongo-express
ports:
- 8081:8081
env_file:
.env
environment:
ME_CONFIG_MONGODB_ADMINUSERNAME: xcoder
ME_CONFIG_MONGODB_ADMINPASSWORD: 4dun4710
ME_CONFIG_OPTIONS_EDITORTHEME: ambiance
ME_CONFIG_BASICAUTH_USERNAME: xcoder
ME_CONFIG_BASICAUTH_PASSWORD: 4dun4710
web:
build: .
ports:
- 5000:5000
env_file:
.env
environment:
ADUNATIO_PRIV_KEY: /code/privkey.pem
FLASK_DEBUG: 1
volumes:
- .:/code
volumes:
mongo_data:
driver_opts:
device: /home/john/PycharmProjects/Adunatio/mongo_data_dir/
type: xfs
o: bind
mongo_data:

@ -4,6 +4,7 @@ from flask_jwt_extended import JWTManager, create_access_token
from mongoengine import connect
from werkzeug.security import check_password_hash ,generate_password_hash
from internal_lib.AuthMethots import AuthJWT
from models.Account import Account
from models.Group import Group, PaymentGroup
from models.Payment import Payments

@ -1,24 +1,9 @@
from mongoengine import *
from models.Union import Union
from restapi import Methods
class Account(Document):
meta = {
'index_background': True,
'index_cls': False,
'auto_create_index': True,
'can_query': True,
'with_sub_docs': True,
'methods': [Methods.Get, Methods.List, Methods.Create],
"indexes": [
('bank'),
("-bank"),
("union"),
('union', 'bank', "deleted")
],
}
union = ReferenceField(Union)
bank = StringField()
number = StringField()

@ -1,52 +1,22 @@
from mongoengine import *
from models.Union import Union
from restapi import Methods
class Group(Document):
meta = {
'index_background': True,
'index_cls': False,
'auto_create_index': True,
'can_query': True,
'with_sub_docs': True,
'methods': [Methods.Get, Methods.List, Methods.Create],
"indexes": [
('name'),
("-name"),
("union","deleted"),
("union","deleted","name"),
],
}
union = ReferenceField(Union)
name = StringField(required=True)
rights = ListField(StringField(), required=True)
rights = ListField(StringField(),required=True)
deleted = BooleanField(default=False)
def __unicode__(self):
return "{} {}".format(self.union.name, self.name)
return "{} {}".format(self.union.name,self.name)
class PaymentGroup(Document):
meta = {
'index_background': True,
'index_cls': False,
'auto_create_index': True,
'can_query': True,
'with_sub_docs': True,
'methods': [Methods.Get, Methods.List, Methods.Create],
"indexes": [
('name'),
("-name"),
("union"),
('union','name',"deleted")
],
}
union = ReferenceField(Union)
name = StringField(required=True)
deleted = BooleanField(default=False)
discount_percent = IntField(required=True)
def __unicode__(self):
return "{} {}".format(self.union.name, self.name)
return "{} {}".format(self.union.name, self.name)

@ -4,26 +4,9 @@ from models.Account import Account
from models.File import File
from models.Union import Union
from models.User import User
from restapi import Methods
class Payments(Document):
meta = {
'index_background': True,
'index_cls': False,
'auto_create_index': True,
'can_query': True,
'with_sub_docs': True,
'methods': [Methods.Get, Methods.List, Methods.Create],
"indexes": [
("union","deleted"),
("union","deleted","account"),
('user',"union"),
('user',"union","deleted"),
('union', "user","income","deleted"),
('union', "user","deleted")
],
}
"""
all payments income and outcome together!
"""

Loading…
Cancel
Save