Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
django-autocomplete-multi-models
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package registry
Model registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hub
django-autocomplete-multi-models
Commits
06cd9580
Commit
06cd9580
authored
2 years ago
by
Bryan BRANCOTTE
Browse files
Options
Downloads
Patches
Plain Diff
prefill when empty
parent
a6e08d3c
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
autocomplete_multi_models/management/commands/makeautocompleteindex.py
+17
-0
17 additions, 0 deletions
...multi_models/management/commands/makeautocompleteindex.py
setup.cfg
+1
-1
1 addition, 1 deletion
setup.cfg
with
18 additions
and
1 deletion
autocomplete_multi_models/management/commands/makeautocompleteindex.py
+
17
−
0
View file @
06cd9580
...
@@ -18,4 +18,21 @@ class Command(BaseCommand):
...
@@ -18,4 +18,21 @@ class Command(BaseCommand):
business_process
.
rebuild_index
()
business_process
.
rebuild_index
()
te
=
time
.
time
()
te
=
time
.
time
()
print
(
f
"
Index rebuild in
{
int
((
te
-
ts
)
*
100
)
/
100
}
s, it contains
{
models
.
IndexedWord
.
objects
.
count
()
}
words
"
)
print
(
f
"
Index rebuild in
{
int
((
te
-
ts
)
*
100
)
/
100
}
s, it contains
{
models
.
IndexedWord
.
objects
.
count
()
}
words
"
)
if
not
models
.
IndexedWord
.
objects
.
exists
():
print
(
"
DB is empty, prefilling it with some words
"
)
for
s
in
[
"
Coming soon
"
,
"
coming soon
"
,
"
coming
"
,
"
soon
"
,
"
Work in progress
"
,
"
work
"
,
"
progress
"
,
"
HUB
"
,
"
Bioinformatics and Biostatistics
"
,
"
Bioinformatics and Biostatistics HUB
"
,
"
bioinformatics
"
,
"
biostatistics
"
,
]:
models
.
IndexedWord
.
objects
.
get_or_create
(
word
=
s
,
occurrence
=
1
)
business_process
.
set_setting_in_storage
(
utils
.
REBUILD_NEEDED
,
False
)
business_process
.
set_setting_in_storage
(
utils
.
REBUILD_NEEDED
,
False
)
This diff is collapsed.
Click to expand it.
setup.cfg
+
1
−
1
View file @
06cd9580
[metadata]
[metadata]
name
=
autocomplete-multi-models
name
=
autocomplete-multi-models
version
=
0.4.
1
version
=
0.4.
3
description
=
An app that index fields across multiple models, and expose an api to query for word similar to the query.
description
=
An app that index fields across multiple models, and expose an api to query for word similar to the query.
long_description
=
file: README.md
long_description
=
file: README.md
author
=
Bryan Brancotte
author
=
Bryan Brancotte
...
...
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