Skip to content
Snippets Groups Projects
Commit fbd5eb92 authored by b4-sharp's avatar b4-sharp
Browse files

Update documentation

parent 634948b0
No related branches found
No related tags found
No related merge requests found
......@@ -6,8 +6,6 @@ from sqlalchemy import select, func
import datetime
from store import *
import re
import random
import string # for autegenarating letters
# Difference between filter and filter_by: https://stackoverflow.com/a/31560897
......@@ -45,11 +43,15 @@ def get_item_set_by_id(itemset_id):
pass
# Search the description of all items to find similar.
# This is intended for use in replacing items in an items,
# and works best when description is close to the target.
# As a result it does not return sold items.
def get_similar_items(description):
"""Search the description of all items to find similar.
This is intended for use in replacing items in an items,
and works best when description is close to the target.
As a result it does not return sold items.
TODO: Do the regex using SQL alchemy so that as much as
possible is handled by the database rather than in memory
for maximum performance.
"""
to_search = get_unsold_items()
found = []
for descriptable in to_search:
......@@ -79,11 +81,6 @@ def remove_item(item):
db.session.commit()
# def remove_item_by_id(item_id):
# get_similar_items() # TODO: Need to get Item object to pass to add similar item to set
# db.session.Item.query()
def get_by_keyword(substring):
"""Search desciption for matching substring. Case insensitive.
This is most useful for a user keyword search.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment