Skip to content

Commit

Permalink
Merge pull request #271 from rice-crc/develop
Browse files Browse the repository at this point in the history
Merge develop into main
  • Loading branch information
derekjkeller authored Nov 8, 2024
2 parents 7aee723 + 2c6ccad commit df37153
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 15 deletions.
7 changes: 4 additions & 3 deletions src/api/common/reqs.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,12 @@ def post_req(orig_queryset,s,r,options_dict,auto_prefetch=True,paginate=False):
# so we filter on each chunk of the name, serially, stripped of punctuation
qobjstrs=[]
for namesegment in namesegments:
qobjstr=f'Q(voyage_enslavement_relations__relation_enslavers__enslaver_alias__alias__icontains="{namesegment}")'
qobjstr=f'Q(voyage_enslavement_relations__relation_enslavers__enslaver_alias__alias__icontains="{namesegment}")|\
Q(voyage_enslavement_relations__relation_enslavers__enslaver_alias__identity__principal_alias__icontains="{namesegment}")'
qobjstrs.append(qobjstr)
qobjstr=' , '.join(qobjstrs)
execobjstr=f'filtered_queryset.filter({qobjstr})'
# print("EXECOBJSTR",execobjstr)
print("EXECOBJSTR",execobjstr)
enslavernamehits=eval(execobjstr)
# print("enslavernamehits",enslavernamehits)
# print("enslavernamehitscount",enslavernamehits.count())
Expand All @@ -222,7 +223,7 @@ def post_req(orig_queryset,s,r,options_dict,auto_prefetch=True,paginate=False):
eirs_unfiltered=er.relation_enslavers.all()
qobjstrs=[]
for namesegment in namesegments:
qobjstr=f'Q(enslaver_alias__alias__icontains="{namesegment}")'
qobjstr=f'Q(enslaver_alias__alias__icontains="{namesegment}")|Q(enslaver_alias__identity__principal_alias__icontains="{namesegment}")'
# print("--->",qobjstr)
qobjstrs.append(qobjstr)
qobjstr=' , '.join(qobjstrs)
Expand Down
26 changes: 16 additions & 10 deletions src/api/document/management/commands/texas_import_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,14 @@ def handle(self, *args, **options):
except:
pass

EnslaverAlias.objects.all().filter(
texas_enslaver_aliases=EnslaverAlias.objects.all().filter(
manual_id__icontains='TEXAS_ENSLAVER'
).delete()



)

for tea in texas_enslaver_aliases:
tea.identity.delete()
tea.delete()

# 1. Run through the two spreadsheets
# A. & create new enslaver identities off each unique name, keeping an alias id for each
# 1. texas_voyage_enslavers:
Expand Down Expand Up @@ -122,18 +124,22 @@ def handle(self, *args, **options):

identity,identity_isnew=EnslaverIdentity.objects.get_or_create(
principal_alias=enslaver_name,
# manual_id=texas_id
)


# if vid=='135509':
# print("AAA",enslaver_name)

alias,alias_isnew=EnslaverAlias.objects.get_or_create(
aliases=EnslaverAlias.objects.filter(
alias=enslaver_name,
identity=identity
)

if len(aliases)==0:
alias=EnslaverAlias.objects.create(
alias=enslaver_name,
identity=identity
)
else:
alias=aliases[0]

alias.manual_id=texas_id
alias.save()

Expand Down
4 changes: 2 additions & 2 deletions src/api/voyages3/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@
site = FileBrowserSite(name='filebrowser')

site.storage.location = "static"
site.directory="uploads/"
site.storage.base_url = "/abcdefg"
site.directory="static/uploads/"
site.storage.base_url = "/static/uploads"

TINYMCE_JS_URL="tinymce/tinymce.min.js"
TINYMCE_DEFAULT_CONFIG = {
Expand Down
3 changes: 3 additions & 0 deletions src/people-networks/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,9 @@ def load_graph():
else:
if len(voyage_uuids)>1:
print("more voyages than we counted on",rc)
elif len(voyage_uuids)==0:
pass
# print(relations_dict)
else:
voyage_uuid=voyage_uuids[0]
# if we have a single voyage, then we know that we're dealing with
Expand Down

0 comments on commit df37153

Please sign in to comment.