Skip to content

Redirecting URL with parameters to appropriate targets, filtering, or creation pages#177

Merged
moira-andrews merged 7 commits intoLCOGT:devfrom
jrfarah:url_names_rework
Apr 15, 2026
Merged

Redirecting URL with parameters to appropriate targets, filtering, or creation pages#177
moira-andrews merged 7 commits intoLCOGT:devfrom
jrfarah:url_names_rework

Conversation

@jrfarah
Copy link
Copy Markdown
Collaborator

@jrfarah jrfarah commented Mar 18, 2026

Implementing the requests from @abostroem in #74

We add functionality to SNEx2 to allow users to navigate target access, filtering, and creation via the URL online. In particular, users can now access targets in a variety of ways via appending /view_object?param1=...&param2=... to the URL. The functionality includes:

  • Access directly by name: /view_object?name=23ixf (or 2023ixf or SN 2023ixf) will take you directly to the target page.
    • Note: if the name is ambiguous you will instead be taken to the target search page with your query already executed.
    • Note: if the name does not match any target (even ambiguously) you will be taken to the target creation page with the field already filled out, defaults to AT unless you provided "SN" in the target name.
  • Access directly by RA/DEC: /view_object?ra=...&dec=... will take you directly to the target with the exactly matching RA/DEC.
    • Note: if none is found, it will take you to the target creation page, pre-filled for convenience.

@jrfarah jrfarah requested a review from moira-andrews March 18, 2026 21:07
@jrfarah jrfarah self-assigned this Mar 18, 2026
@jrfarah jrfarah added the enhancement New feature or request label Mar 18, 2026
@jrfarah
Copy link
Copy Markdown
Collaborator Author

jrfarah commented Mar 18, 2026

@moira-andrews gave feedback that this may be duplicating some already existing functionality within snex2 (used for the searchbar).

Comment thread custom_code/views.py Outdated
@moira-andrews
Copy link
Copy Markdown
Collaborator

while updating the target name search, can also test to make sure it will remove trailing spaces as well.

@jrfarah
Copy link
Copy Markdown
Collaborator Author

jrfarah commented Mar 18, 2026

@moira-andrews it is sanitized. I already tested this in an earlier version per @dahowell 's issue this morning. Tests: I tried searching for "23ixf " -> it goes to target creation and populates with "AT 2023ixf" (no trailing space). I tried searching for "SN 2024ehs " -> it takes directly to target page for "SN 2024ehs" (no trailing space). Seems to be working.

@jrfarah jrfarah linked an issue Mar 19, 2026 that may be closed by this pull request
@moira-andrews
Copy link
Copy Markdown
Collaborator

We should take another look at this with the redirect url. Also, might be nice to be able to have ra, dec, and name, like 127.0.0.1:8889/view_object?ra=123.1234&dec=12.2135&name=24xal and have it redirect to the target create with all 3 filled out. Tested on the current version and it didn't work, it only filled out the ra and dec.

@moira-andrews moira-andrews merged commit 3af645a into LCOGT:dev Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

access targets via target name in url

2 participants