-
-
Notifications
You must be signed in to change notification settings - Fork 25
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
[API Hangouts] Create Model for Hangouts Endpoint #164
Comments
Ok. Clearly more work to do, but here is a first shot at a class Hangout(models.Model):
HANGOUT_TYPES = [
('WATCH', 'Watch Me Code'),
('PRES', 'Presentation'),
('COWRK', 'Co-work with Me'),
('STUDY', 'Study Group'),
('PAIR', 'Pairing'),
('ACNT', 'Keep Me Accountable'),
('DISC', 'Discussion'),
('TEACH', 'I have something to teach'),
]
guid = models.UUIDField(default=uuid.uuid1, editable=False)
#One of scheduled, pending, rescheduled, stale, hold, closed, completed
status = models.CharField(blank=True, max_length=200)
hangout_type = models.CharField(max_length=6, choices=HANGOUT_TYPES)
#we are going to require a title
title = models.CharField(max_length=200, blank=False)
slug = models.SlugField(verbose_name=_("Slug"), max_length=100, allow_unicode=True)
short_description = models.TextField(max_length=300, blank=False, null=False)
long_description = models.TextField(max_length=600, blank=True, null=True)
# user who "owns" the hangout we'll pull this from their TOKEN
user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.SET(get_sentinel_user))
#sort of a public/private thing and confirmed/not confirmed thing
open_to_RSVP = models.BooleanField(blank=False, null=False, default=False)
#pending_rsvps = models.ManyToMany(settings.AUTH_USER_MODEL, on_delete=models.SET(get_sentinel_user))
#confirmed_rsvps = models.ManyToMany(settings.AUTH_USER_MODEL, on_delete=models.SET(get_sentinel_user))
related_responses = models.ForeignKey(HangoutResponses, on_delete=models.CASCADE, blank=True, null=True)
#Calendar date + start time would be derived from the datetime object
start_time = models.DateTimeField(default=timezone.now)
#Calendar date + end time would be derived from the datetime object
end_time = models.DateTimeField(blank=False, null=False)
# creation date of hangout entry
created = models.DateTimeField(auto_now_add=True)
# modification date of hangout entry
modified = models.DateTimeField(default=timezone.now)
recurring = models.BooleanField(null=False, default=False)
#related_sessions = models.ForeignKey(Sessions, on_delete=models.CASCADE, blank=True, null=True)
internal_platform = models.BooleanField(null=False, default=True)
external_platform_link = models.URLField(max_length=300, blank-True, null=True)
related_resources = models.ManyToManyField(Resource, blank=True, null=True, related_name='related_hangouts')
#related_notes = models.ForeignKey(Notes, on_delete=models.CASCADE, blank=True, null=True)
# Allow tags to be used across entities
# E.g. so we can create composite views showing all entities sharing a common tag
tags = TaggableManager(through=TaggedItems, manager=CustomTaggableManager, blank=True)
``` |
If this looks "good enough", we can quickly implement this so we can start iterating on other pieces. |
Currently, I am thinking we will also need a child table for related sessions, |
So this is pretty rough, but here is a first pass at a
class HangoutResponses:(models.Model):
hangout_id = models.ForeignKey(Hangout, on_delete=models.CASCADE, blank=True,
null=True, related_name='related_responses')
hangout_session_id = models.ForeignKey(HangoutSessions, on_delete=models.CASCADE,
blank=True, null=True, related_name='related_session_responses')
user_id = user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.SET(get_sentinel_user))
express_interest = models.BooleanField(blank=False, null=False, default=False)
request_to_join = models.BooleanField(blank=False, null=False, default=False)
rsvp = models.BooleanField(blank=False, null=False, default=False)
response_comment = models.TextField(max_length=300, blank=True, null=True)
status = models.TextField(max_length=10, blank=False, null=False) |
Related Sessions model: class HangoutSessions(models.Model):
hangout_id = models.ForeignKey(Hangout, on_delete=models.CASCADE, blank=True, null=True,
related_name='related_sessions')
status = models.CharField(blank=True, max_length=200) #scheduled, pending, rescheduled, stale, hold, closed, completed
start_time = DateTimeField(default=timezone.now)
end_time = DateTimeField(blank=False, null=False)
related_resources = models.ManyToManyField(Resource, blank=True, null=True, related_name='related_hangout_sessions')
created = models.DateTimeField(auto_now_add=True)
modified = models.DateTimeField(default=timezone.now) |
Looking at this one last time, I am not sure if we want to track RSVPs in |
Took a look at your draft PR -- first, THANK YOU for leaving really clear inline comments for the fields! Looks great as a first pass! I'm a little confused about the Not sure if you still are looking for discussion on the questions you posed above, but taking a stab at answering...
I think your idea to separate out the messages of interest in a separate HangoutResponses table makes sense.
Yes, a status should get updated when a hangout moves from "proposed" to "confirmed." At the moment, I don't think
Ahhh good questions. If we let people comment more than once, we'll have to create a separate table for that, right? 😅 To be simple, let's punt on that feature and leave it so that people can only comment once now. (We can give them the ability to edit their comment) I think behavior-wise this will also force the hangout proposer-r to be descriptive with their proposal 🤞
#pending - initial status of a hangout |
So my thought with the |
I intended |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
still open. |
PARENT TRACKING ISSUE
: #160Based on the current proposed hangouts JSON, create a hangout model for the corresponding DB tables to support the hangouts DRF app.
JSON spec under discussion can be found in issue #161, check there for any changes/discussion.
The text was updated successfully, but these errors were encountered: