Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3175 courthouses - Add Courthouse Table to search #3184

Merged
merged 8 commits into from
Sep 26, 2023
Merged

Conversation

flooie
Copy link
Contributor

@flooie flooie commented Sep 25, 2023

PR Resolves the following Issues

Address #3175

This PR

  • Creates Courthouse table in search model
  • Updates Court Model to
    • Add appellate path in the Court table
    • Add Parent/Child relationship for Court table
      • NOTE: This will allow for grouping courts together that are of the same kind or of the same parent court (ie Boston Municipal Court - is a Massachusetts District Court)
    • Adds two new jurisdictions (Military Trial/ Military Appellate)

Update search model to add Courthouse table
Add Parent Court field
Add Appellate Court field

Add military jurisdictions
Add migration files for newly minted
Courthouse and Update to Court Tables
@semgrep-app
Copy link

semgrep-app bot commented Sep 25, 2023

Semgrep found 7 no-null-string-field findings:

Avoid using null on string-based fields such as CharField and TextField. If a string-based field has null=True, that means it has two possible values for "no data": NULL, and the empty string. In most cases, it's redundant to have two possible values for "no data;" the Django convention is to use the empty string, not NULL.

Ignore this finding from no-null-string-field.

@flooie
Copy link
Contributor Author

flooie commented Sep 25, 2023

PR also address the model requirements in #3176 and in #3177 but will close those when data is added.

@flooie
Copy link
Contributor Author

flooie commented Sep 25, 2023

@mlissner I'm of the mind to ignore the semgrep warning here- as being inconsistent with our normal practice but I could change it. Otherwise- I think it should be ready for you.

@flooie flooie marked this pull request as draft September 25, 2023 20:05
@flooie flooie marked this pull request as ready for review September 25, 2023 20:21
Copy link
Member

@mlissner mlissner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments, thank you!

cl/search/models.py Outdated Show resolved Hide resolved
cl/search/models.py Outdated Show resolved Hide resolved
cl/search/models.py Show resolved Hide resolved
@flooie
Copy link
Contributor Author

flooie commented Sep 25, 2023

@mlissner thank you for the suggestions. I believe this should address them.

cl/search/models.py Outdated Show resolved Hide resolved
cl/search/models.py Outdated Show resolved Hide resolved
flooie and others added 2 commits September 25, 2023 18:48
Appease semgrep that wanted null on blankable
char fields

Update migration
cl/search/models.py Outdated Show resolved Hide resolved
cl/search/models.py Outdated Show resolved Hide resolved
cl/search/models.py Outdated Show resolved Hide resolved
cl/search/models.py Outdated Show resolved Hide resolved
cl/search/models.py Outdated Show resolved Hide resolved
Copy link
Member

@mlissner mlissner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few more comments. Two more:

  • Why did you add indexes to a bunch of the fields?
  • In general, the help_text field should be the first argument to a model field (or second when it's a FK or M2M field).

@flooie
Copy link
Contributor Author

flooie commented Sep 26, 2023

When I looked at the attorney address model that you pointed to I saw it had plenty of indexes and I thought I must have been missing something. So I followed the lead.

cl/search/models.py Outdated Show resolved Hide resolved
@flooie
Copy link
Contributor Author

flooie commented Sep 26, 2023

@mlissner back to you. 🏓

I created a simple two list set for country codes because I didnt want to install Django-countries to do what you were discussing above.

cl/search/models.py Show resolved Hide resolved
@mlissner mlissner merged commit ce0ead3 into main Sep 26, 2023
11 checks passed
@mlissner mlissner deleted the 3175-courthouses branch September 26, 2023 05:29
@mlissner
Copy link
Member

I merged this so it's in the code, but deploy will have to wait until tomorrow.

@flooie
Copy link
Contributor Author

flooie commented Sep 26, 2023

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants