1👍
jgrp = group.objects.get(groupname=juser.group)
This code is perfectly valid. problem is, there is no corresponding group object for your account.group value.
I also think that your data model is not really ideal for a relational db. I think you should have a foreign key from your account model to group model so you can just use juser.group as @knapo suggested.
0👍
group
is an object and you need the name of the group. So probally =juser.group.name
- [Answer]-Reason of exception invalid literal for int() with base 10:
- [Answer]-Django if statement not working
- [Answer]-How to store variable length list of dict-type objects with FKs in Django SQL DB
- [Answer]-Django. Sending email with an application
- [Answer]-How to store/deal with django exception webpages in acceptance testing
- [Answer]-API endpoint confusion
- [Answer]-Accessing feinCMS urls in django templates
- [Answer]-Issue with my app engine (i.e. meya.appspot.com)
- [Answer]-Unable to host Django app on Google Cloud Platform
- [Answer]-Django app + nginx fail to server static files
Source:stackexchange.com