2π
β
As of latest version in Djongo, this structure is still not possible if you want to have automatic support for Admin Panel. Having said that, you can always use ListField
and write custom view for the admin panel which is a valid solution for now. Also donβt see any timeline in which that will be fixed by the developer.
π€hello world
- [Django]-Getting time of form submission in Django
- [Django]-Urlencode filter is not working in django templates
0π
For your use case, where the database connected is a MongoDB, you can do this:
from djongo import models
from django.contrib.postgres.fields import ArrayField
class Option(models.Model):
.
.
.
class Quiz(models.Model):
_id = models.ObjectIdField()
question = models.TextField(null=True, blank=True)
options = models.ArrayField(models.CharField(max_length=1024, blank=True),size=8)
this will show your options in a comma-separated manner i.e. A,B,C
attaching a screenshot for example
π€Mayank Arya
- [Django]-Django Rest Framework: Use URL parameter in serializer
- [Django]-Mapping LDAP users to Django users with Django Auth Ldap
Source:stackexchange.com