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

Collections #1810

Draft
wants to merge 19 commits into
base: master
Choose a base branch
from
Draft

Collections #1810

wants to merge 19 commits into from

Conversation

quimmrc
Copy link
Contributor

@quimmrc quimmrc commented Jan 16, 2025

Issue(s)
#1029

Description
App creation and first implementations of basic functionalitites for collections.

class Collection(models.Model):

author = models.ForeignKey(User, on_delete=models.CASCADE)
name = models.CharField(max_length=128, default="BookmarkCollection") #add restrictions
Copy link
Member

Choose a reason for hiding this comment

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

No need to specify a default

@@ -927,6 +928,8 @@
# -------------------------------------------------------------------------------
# Extra Freesound settings

Copy link
Member

Choose a reason for hiding this comment

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

Maybe rename this to ENABLE COLLECTIONS?


user = models.ForeignKey(User, on_delete=models.CASCADE)
name = models.CharField(max_length=255) #max_length as in Packs (128 for Bookmarks)
created = models.DateTimeField(db_index=True, auto_now_add=True)
Copy link
Member

Choose a reason for hiding this comment

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

add modified field

collection = models.ForeignKey(Collection, related_name='collectionsound', on_delete=models.CASCADE)
created = models.DateTimeField(db_index=True, auto_now_add=True)

STATUS_CHOICES = (
Copy link
Member

Choose a reason for hiding this comment

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

Options:

  • Accepted
  • Pending
  • Refused

def delete_collection(request, collection_id):
collection = get_object_or_404(Collection, id=collection_id)

if request.user==collection.user:
Copy link
Member

Choose a reason for hiding this comment

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

Consider else case, return 404 or reload edit page but with a message saying that user is not allowed

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