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: services:
mongo: mongo:
image: mongo image: mongo
env_file: environment:
.env MONGO_INITDB_ROOT_USERNAME: xcoder
MONGO_INITDB_ROOT_PASSWORD: 4dun4710
volumes: volumes:
- mongo_data:/data/db/ - mongo_data:/data/db/
@ -12,22 +13,22 @@ services:
image: mongo-express image: mongo-express
ports: ports:
- 8081:8081 - 8081:8081
env_file: environment:
.env 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: web:
build: . build: .
ports: ports:
- 5000:5000 - 5000:5000
env_file: environment:
.env ADUNATIO_PRIV_KEY: /code/privkey.pem
FLASK_DEBUG: 1
volumes: volumes:
- .:/code - .:/code
volumes: volumes:
mongo_data: mongo_data:
driver_opts:
device: /home/john/PycharmProjects/Adunatio/mongo_data_dir/
type: xfs
o: bind

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

@ -1,24 +1,9 @@
from mongoengine import * from mongoengine import *
from models.Union import Union from models.Union import Union
from restapi import Methods
class Account(Document): 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) union = ReferenceField(Union)
bank = StringField() bank = StringField()
number = StringField() number = StringField()

@ -1,52 +1,22 @@
from mongoengine import * from mongoengine import *
from models.Union import Union from models.Union import Union
from restapi import Methods
class Group(Document): 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) union = ReferenceField(Union)
name = StringField(required=True) name = StringField(required=True)
rights = ListField(StringField(), required=True) rights = ListField(StringField(),required=True)
deleted = BooleanField(default=False) deleted = BooleanField(default=False)
def __unicode__(self): def __unicode__(self):
return "{} {}".format(self.union.name, self.name) return "{} {}".format(self.union.name,self.name)
class PaymentGroup(Document): 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) union = ReferenceField(Union)
name = StringField(required=True) name = StringField(required=True)
deleted = BooleanField(default=False) deleted = BooleanField(default=False)
discount_percent = IntField(required=True) discount_percent = IntField(required=True)
def __unicode__(self): 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.File import File
from models.Union import Union from models.Union import Union
from models.User import User from models.User import User
from restapi import Methods
class Payments(Document): 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! all payments income and outcome together!
""" """

Loading…
Cancel
Save