Skip to content

Conversation

@girumb
Copy link
Contributor

@girumb girumb commented Nov 18, 2024

No description provided.

@girumb girumb requested a review from rhunwicks November 18, 2024 13:23
@girumb girumb self-assigned this Nov 18, 2024
hea/urls.py Outdated
router.register(r"unitofmeasure", UnitOfMeasureViewSet)
router.register(r"classifiedproduct", ClassifiedProductViewSet)
router.register(r"user", UserViewSet)
router.register(r"heaprofile", HeaProfileViewSet)
Copy link
Contributor

Choose a reason for hiding this comment

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

@girumb I think i would prefer if this was /userprofile, and the model was UserProfile, etc. It is in common so it is not supposed to be specific. It's too late for FDW now, but I would like a model that we can just copy without changes into the next application we build.


class HeaProfile(Model):
"""
A profile to store data associated with a user to be used by the Livelihoods Explorer
Copy link
Contributor

Choose a reason for hiding this comment

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

A profile to store data associated with a user to enable a customized user experience.

"""

user = models.OneToOneField(User, on_delete=CASCADE, primary_key=True, unique=True)
expert = models.BooleanField(default=False)
Copy link
Contributor

Choose a reason for hiding this comment

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

@Jake-Stoll do you need expert, skip_tour and tour_last_viewed as concrete fields in the HEA user profile? Will we have a tour or an expert mode? If we do, would they be better implemented as part of the JSON structure?

expert = models.BooleanField(default=False)
skip_tour = models.BooleanField(default=False)
tour_last_viewed = models.DateField(null=True)
livelihood_explorer_data = models.JSONField(default=dict, null=True, blank=True)
Copy link
Contributor

Choose a reason for hiding this comment

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

user_data = models.JSONField(default=dict, null=True, blank=True, verbose_name=_("user data"))

livelihood_explorer_data = models.JSONField(default=dict, null=True, blank=True)

def __str__(self):
return f"hea_profile: {str(self.user)}"
Copy link
Contributor

Choose a reason for hiding this comment

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

return f"user_profile: {str(self.user)}"

@rhunwicks rhunwicks merged commit 2c0270d into main Nov 22, 2024
17 checks passed
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.

3 participants