Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
5e927ba
init
iamrbtm Aug 18, 2021
984468e
init
iamrbtm Aug 21, 2021
0ca3095
init
iamrbtm Aug 22, 2021
6f5dec9
init
iamrbtm Aug 23, 2021
c7a917e
init
iamrbtm Aug 23, 2021
cf0b16f
init
iamrbtm Aug 24, 2021
375a447
init
iamrbtm Aug 25, 2021
0c0f295
init
iamrbtm Aug 27, 2021
3880709
init
iamrbtm Aug 30, 2021
4b5f1c0
init
iamrbtm Aug 30, 2021
af6128a
init
iamrbtm Sep 1, 2021
5987d5f
init
iamrbtm Sep 2, 2021
e4a6de3
init
iamrbtm Sep 5, 2021
77090ba
init
iamrbtm Sep 5, 2021
af7b80d
init
iamrbtm Sep 5, 2021
f6197ec
init
iamrbtm Sep 6, 2021
a6dc819
init
iamrbtm Sep 7, 2021
2da933b
init
iamrbtm Sep 7, 2021
f1d6c3d
init
iamrbtm Sep 7, 2021
7178fa2
init
iamrbtm Sep 7, 2021
032b057
init
iamrbtm Sep 9, 2021
662cda9
init
iamrbtm Sep 15, 2021
7d5726b
init
iamrbtm Sep 18, 2021
a696803
init
iamrbtm Sep 19, 2021
9e8a580
init
iamrbtm Sep 20, 2021
9daf0ff
init
iamrbtm Sep 25, 2021
9bd07e8
init
iamrbtm Sep 27, 2021
2639016
init
iamrbtm Sep 27, 2021
f2feb7c
init
iamrbtm Sep 27, 2021
5d61233
init
iamrbtm Sep 27, 2021
6fa4e5a
init
iamrbtm Sep 28, 2021
388c456
init
iamrbtm Sep 28, 2021
7d5e807
init
iamrbtm Oct 3, 2021
91f2f2e
init
iamrbtm Oct 2, 2021
dc03ce6
init
iamrbtm Oct 4, 2021
3b5b29c
init
iamrbtm Oct 4, 2021
7031db2
init
iamrbtm Oct 5, 2021
7c23d40
init
iamrbtm Oct 7, 2021
8cae10e
init
iamrbtm Oct 7, 2021
dcbc2d6
init
iamrbtm Oct 7, 2021
029587c
init
iamrbtm Oct 7, 2021
94d0116
init
iamrbtm Oct 7, 2021
4211c5f
init
iamrbtm Oct 10, 2021
2ac978b
init
iamrbtm Oct 11, 2021
0f755cb
init
iamrbtm Oct 12, 2021
14bed67
init
iamrbtm Oct 13, 2021
0444a98
init
iamrbtm Oct 13, 2021
44b5c94
init
iamrbtm Oct 13, 2021
3d36a42
init
iamrbtm Oct 14, 2021
9fb6ac3
init
iamrbtm Oct 14, 2021
f0130b4
init
iamrbtm Oct 14, 2021
845208c
init
iamrbtm Oct 15, 2021
0b053f1
init
iamrbtm Oct 16, 2021
9cc91bc
init
iamrbtm Oct 16, 2021
e8c7cf9
init
iamrbtm Oct 18, 2021
e520362
init
iamrbtm Oct 18, 2021
c806b54
init
iamrbtm Oct 18, 2021
b9f41e4
init
iamrbtm Oct 18, 2021
fa0f38e
init
iamrbtm Oct 20, 2021
abdf92d
init
iamrbtm Oct 21, 2021
27b50b1
init
iamrbtm Oct 21, 2021
ac6dd40
init
iamrbtm Oct 22, 2021
a10b402
init
iamrbtm Oct 22, 2021
5203ba9
init
iamrbtm Oct 24, 2021
be3de0b
init
iamrbtm Oct 24, 2021
6f0f5d0
init
iamrbtm Oct 24, 2021
f9dea70
init
iamrbtm Oct 24, 2021
8b23ac7
init
iamrbtm Oct 24, 2021
dbb5471
init
iamrbtm Oct 26, 2021
e7ff20b
init
iamrbtm Oct 26, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
27 changes: 27 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal"
},
{
"name": "Python: Flask",
"type": "python",
"request": "launch",
"module": "flask",
"env": {
"FLASK_APP": "app.py",
"FLASK_ENV": "development"
},
"args": ["run", "--no-debugger"],
"jinja": true
}
]
}
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
# Flask-Blog-Tutorial
A blog application in python using Flask.
# Guill Localhost

A varity of things that go into this website...

1. A reordering system for cpap supplies.
2. A menu planning app (recipes, nutrition and planning)
Binary file added __pycache__/app.cpython-38.pyc
Binary file not shown.
File renamed without changes.
58 changes: 58 additions & 0 deletions life.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Life Program

## Migration
### Installation

`pip install Flask-Migrate`

### Instantiation
Inside the __init__.py file insert the following command after both the app and db have been initalized.

`Migrate(app, db)`

### Usage
### Initial

`flask db init`

This will come up with a message saying you need to configure a file. Unless there is a specific reason to do so, simply skip that suggestion.
### Every time you change model.py
use the following commands in order in the terminal:

`flask db migrate`

`flask db upgrade`


## Sections
---
### Health
#### *Facilities*
#### *Doctors*
#### *Medications*
#### *Medication List*
#### *Hospitalizations*
#### *Allergies*
#### *Surgeries*
#### *A1C*
#### *C-PAP*
----
### Productivity
#### *Tasks*
#### *Goals*
#### *Projects*
----
### Menu Planner
#### *Planner*
#### *Reciepts*
#### *Shopping List*
<br><br><br>

# THINGS TO DO
<ul><li>[ ] Make a page that has archive plan information. a place you can look back at different weeks and see what you had</li>
<li>[ ] Code Snippits</li>
<li>[ ] Text the person when the medication is due to be refilled.</li>
<li>[ ] Create a wallet size report in pdf that can be printed out</li>
<li>[ ] Place the keys in the database</li>
<li>[ ] Make each menu item selectable according to user (menu on for me off for shawn for example)</li>
<li>[X] Grave markers</li>
1 change: 1 addition & 0 deletions migrations/README
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Single-database configuration for Flask.
Binary file added migrations/__pycache__/env.cpython-38.pyc
Binary file not shown.
50 changes: 50 additions & 0 deletions migrations/alembic.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# A generic, single database configuration.

[alembic]
# template used to generate migration files
# file_template = %%(rev)s_%%(slug)s

# set to 'true' to run the environment during
# the 'revision' command, regardless of autogenerate
# revision_environment = false


# Logging configuration
[loggers]
keys = root,sqlalchemy,alembic,flask_migrate

[handlers]
keys = console

[formatters]
keys = generic

[logger_root]
level = WARN
handlers = console
qualname =

[logger_sqlalchemy]
level = WARN
handlers =
qualname = sqlalchemy.engine

[logger_alembic]
level = INFO
handlers =
qualname = alembic

[logger_flask_migrate]
level = INFO
handlers =
qualname = flask_migrate

[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic

[formatter_generic]
format = %(levelname)-5.5s [%(name)s] %(message)s
datefmt = %H:%M:%S
91 changes: 91 additions & 0 deletions migrations/env.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
from __future__ import with_statement

import logging
from logging.config import fileConfig

from flask import current_app

from alembic import context

# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config

# Interpret the config file for Python logging.
# This line sets up loggers basically.
fileConfig(config.config_file_name)
logger = logging.getLogger('alembic.env')

# add your model's MetaData object here
# for 'autogenerate' support
# from myapp import mymodel
# target_metadata = mymodel.Base.metadata
config.set_main_option(
'sqlalchemy.url',
str(current_app.extensions['migrate'].db.get_engine().url).replace(
'%', '%%'))
target_metadata = current_app.extensions['migrate'].db.metadata

# other values from the config, defined by the needs of env.py,
# can be acquired:
# my_important_option = config.get_main_option("my_important_option")
# ... etc.


def run_migrations_offline():
"""Run migrations in 'offline' mode.

This configures the context with just a URL
and not an Engine, though an Engine is acceptable
here as well. By skipping the Engine creation
we don't even need a DBAPI to be available.

Calls to context.execute() here emit the given string to the
script output.

"""
url = config.get_main_option("sqlalchemy.url")
context.configure(
url=url, target_metadata=target_metadata, literal_binds=True
)

with context.begin_transaction():
context.run_migrations()


def run_migrations_online():
"""Run migrations in 'online' mode.

In this scenario we need to create an Engine
and associate a connection with the context.

"""

# this callback is used to prevent an auto-migration from being generated
# when there are no changes to the schema
# reference: http://alembic.zzzcomputing.com/en/latest/cookbook.html
def process_revision_directives(context, revision, directives):
if getattr(config.cmd_opts, 'autogenerate', False):
script = directives[0]
if script.upgrade_ops.is_empty():
directives[:] = []
logger.info('No changes in schema detected.')

connectable = current_app.extensions['migrate'].db.get_engine()

with connectable.connect() as connection:
context.configure(
connection=connection,
target_metadata=target_metadata,
process_revision_directives=process_revision_directives,
**current_app.extensions['migrate'].configure_args
)

with context.begin_transaction():
context.run_migrations()


if context.is_offline_mode():
run_migrations_offline()
else:
run_migrations_online()
24 changes: 24 additions & 0 deletions migrations/script.py.mako
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"""${message}

Revision ID: ${up_revision}
Revises: ${down_revision | comma,n}
Create Date: ${create_date}

"""
from alembic import op
import sqlalchemy as sa
${imports if imports else ""}

# revision identifiers, used by Alembic.
revision = ${repr(up_revision)}
down_revision = ${repr(down_revision)}
branch_labels = ${repr(branch_labels)}
depends_on = ${repr(depends_on)}


def upgrade():
${upgrades if upgrades else "pass"}


def downgrade():
${downgrades if downgrades else "pass"}
34 changes: 34 additions & 0 deletions migrations/versions/05b53be3df1a_.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
"""empty message

Revision ID: 05b53be3df1a
Revises: e3e2601b7244
Create Date: 2021-10-22 22:57:31.507543

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '05b53be3df1a'
down_revision = 'e3e2601b7244'
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('graves', schema=None) as batch_op:
batch_op.add_column(sa.Column('cemeteriesfk', sa.Integer(), nullable=False))
batch_op.create_foreign_key(None, 'cemeteries', ['cemeteriesfk'], ['id'], ondelete='CASCADE')

# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('graves', schema=None) as batch_op:
batch_op.drop_constraint(None, type_='foreignkey')
batch_op.drop_column('cemeteriesfk')

# ### end Alembic commands ###
37 changes: 37 additions & 0 deletions migrations/versions/91a98db2aa76_.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
"""empty message

Revision ID: 91a98db2aa76
Revises: 05b53be3df1a
Create Date: 2021-10-26 00:16:55.334374

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '91a98db2aa76'
down_revision = '05b53be3df1a'
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('insinfo',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('name', sa.Text(), nullable=True),
sa.Column('phone', sa.Text(), nullable=True),
sa.Column('policynum', sa.Text(), nullable=True),
sa.Column('userid', sa.Integer(), nullable=True),
sa.Column('update_time', sa.DateTime(), nullable=True),
sa.Column('date_created', sa.DateTime(timezone=True), nullable=True),
sa.PrimaryKeyConstraint('id')
)
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('insinfo')
# ### end Alembic commands ###
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading