Skip to content

Commit

Permalink
Merge pull request #58 from arthur-schnitzler/main
Browse files Browse the repository at this point in the history
updates
  • Loading branch information
csae8092 authored Jan 29, 2024
2 parents 142d200 + 29dec22 commit a70753d
Show file tree
Hide file tree
Showing 7 changed files with 258 additions and 257 deletions.
249 changes: 0 additions & 249 deletions apis_core/apis_relations/autocomplete_light_registry.py

This file was deleted.

7 changes: 1 addition & 6 deletions apis_core/apis_relations/forms2.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,12 @@
from apis_core.apis_entities.fields import ListSelect2
from apis_core.apis_entities.models import AbstractEntity

# from dal.autocomplete import ListSelect2
from apis_core.apis_metainfo.models import TempEntityClass, Uri
from apis_core.apis_relations.models import AbstractRelation
from apis_core.helper_functions import DateParser

from .tables import get_generic_relations_table

# from dal.autocomplete import ListSelect2


def validate_target_autocomplete(value):
try:
Expand Down Expand Up @@ -130,7 +127,7 @@ def __init__(self, siteID=None, highlighter=False, *args, **kwargs):
"""
attrs = {
"data-placeholder": "Type to get suggestions",
"data-minimum-input-length": getattr(settings, "APIS_MIN_CHAR", 3),
"data-minimum-input-length": 0,
"data-html": True,
"style": "width: 100%",
}
Expand Down Expand Up @@ -262,7 +259,6 @@ def __init__(self, siteID=None, highlighter=False, *args, **kwargs):
self.fields["relation_type"] = autocomplete.Select2ListCreateChoiceField(
label="Relation type",
widget=ListSelect2(
# url='/vocabularies/autocomplete/{}{}relation/reverse'.format(lst_src_target[0].lower(), lst_src_target[1].lower()),
url=reverse(
"apis:apis_vocabularies:generic_vocabularies_autocomplete",
args=[
Expand All @@ -282,7 +278,6 @@ def __init__(self, siteID=None, highlighter=False, *args, **kwargs):
self.fields["target"] = autocomplete.Select2ListCreateChoiceField(
label=lst_src_target[0],
widget=ListSelect2(
# url='/entities/autocomplete/{}'.format(lst_src_target[0].lower()),
url=reverse(
"apis:apis_entities:generic_entities_autocomplete",
args=[lst_src_target[0].lower()],
Expand Down
1 change: 1 addition & 0 deletions apis_core/apis_relations/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class AbstractRelation(TempEntityClass):
class Meta:
abstract = True
default_manager_name = "objects"
ordering = ["start_date", "id"]

def save(self, *args, **kwargs):
if (
Expand Down
2 changes: 1 addition & 1 deletion apis_core/apis_vocabularies/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def save_model(self, request, obj, form, change):
def formfield_for_foreignkey(self, db_field, request, **kwargs):
attrs = {
"data-placeholder": "Type to get suggestions",
"data-minimum-input-length": getattr(settings, "APIS_MIN_CHAR", 3),
"data-minimum-input-length": 0,
"data-html": True,
}
c_name = db_field.model.__name__
Expand Down
Loading

0 comments on commit a70753d

Please sign in to comment.