-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Dandiset star functionality with UI components
- Introduced DandisetStar model and admin interface for managing starred Dandisets. - Implemented star/unstar actions in the DandisetViewSet and corresponding API endpoints. - Added star count and starred status to DandisetSerializer. - Created StarButton component for toggling star status in the UI. - Developed StarredDandisetsView to display Dandisets starred by the user. - Updated DandisetList and DandisetLandingView to include star functionality. - Enhanced DandisetFilterBackend to support ordering by star count.
- Loading branch information
1 parent
d30aab9
commit 2bfa8d1
Showing
17 changed files
with
7,351 additions
and
514 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Generated by Django 4.2.17 on 2024-12-26 14:24 | ||
|
||
from django.conf import settings | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
('api', '0013_remove_assetpath_consistent_slash_and_more'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='DandisetStar', | ||
fields=[ | ||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('created', models.DateTimeField(auto_now_add=True)), | ||
('dandiset', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='stars', to='api.dandiset')), | ||
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='starred_dandisets', to=settings.AUTH_USER_MODEL)), | ||
], | ||
options={ | ||
'unique_together': {('user', 'dandiset')}, | ||
}, | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.