Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
jchate6 committed Jul 3, 2024
2 parents e47701a + 13d63fe commit 61d5c71
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ TOMtoolkit module for reporting transients to the TNS
```


4. Include the tom_tns URLconf in your project `urls.py`:
4. Include the tom_tns URLconf in your project `urls.py` if you are using a tomtoolkit version <= 2.18:
```python
urlpatterns = [
...
Expand Down
32 changes: 26 additions & 6 deletions tom_tns/apps.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,32 @@
from django.apps import AppConfig
from django.urls import path, include


class TomTnsConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'tom_tns'
integration_points = {'target_detail_button': {'namespace': 'tns:report-tns',
'title': 'TNS',
'class': 'btn btn-info',
'text': 'TNS',
}
}

def target_detail_buttons(self):
"""
Integration point for adding buttons to the target detail view.
This method should return a list of dictionaries, each containing the keys:
- 'namespace': The namespace of the app that provides the button's view
- 'title': The title of the button
- 'class': The CSS class of the button
- 'text': The text of the button
"""
return {'namespace': 'tns:report-tns',
'title': 'TNS',
'class': 'btn btn-info',
'text': 'TNS',
}

def include_url_paths(self):
"""
Integration point for adding URL patterns to the Tom Common URL configuration.
This method should return a list of URL patterns to be included in the main URL configuration.
"""
urlpatterns = [
path('tns/', include('tom_tns.urls', namespace='tns'))
]
return urlpatterns

0 comments on commit 61d5c71

Please sign in to comment.