Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
Online Store - SD Project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
b4-sharp
Online Store - SD Project
Commits
fbd5eb92
Commit
fbd5eb92
authored
2 years ago
by
b4-sharp
Browse files
Options
Downloads
Patches
Plain Diff
Update documentation
parent
634948b0
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
store/utility.py
+8
-11
8 additions, 11 deletions
store/utility.py
with
8 additions
and
11 deletions
store/utility.py
+
8
−
11
View file @
fbd5eb92
...
...
@@ -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.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment