We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'm getting an error when trying to use get_or_create, it say that the field is not recognized.
This works:
golf = ReceiptCategory.objects.language('en').create(name="Golf")
This don't work golf = ReceiptCategory.objects.language('en').get_or_create(name="Golf")
golf = ReceiptCategory.objects.language('en').get_or_create(name="Golf")
The error I'm getting is django.core.exceptions.FieldError: Cannot resolve keyword 'name' into field. Choices are: id, kind, receipts, translations, user, user_id
django.core.exceptions.FieldError: Cannot resolve keyword 'name' into field. Choices are: id, kind, receipts, translations, user, user_id
The model
class ReceiptCategory(TranslatableModel): user = models.ForeignKey('core.user', null=True, blank=True, on_delete=models.SET_NULL) translations = TranslatedFields( name = models.CharField("Name", max_length=128) ) kind = models.IntegerField(choices=OwnershipType.choices, default=OwnershipType.STANDARD)
The text was updated successfully, but these errors were encountered:
same with get()
get()
Sorry, something went wrong.
Try to query with translations__name
No branches or pull requests
I'm getting an error when trying to use get_or_create, it say that the field is not recognized.
This works:
golf = ReceiptCategory.objects.language('en').create(name="Golf")
This don't work
golf = ReceiptCategory.objects.language('en').get_or_create(name="Golf")
The error I'm getting is
django.core.exceptions.FieldError: Cannot resolve keyword 'name' into field. Choices are: id, kind, receipts, translations, user, user_id
The model
The text was updated successfully, but these errors were encountered: