Is it possible to models.ArrayReferenceField(null=True,)?

39 views
Skip to first unread message

spam spam

unread,
Nov 14, 2021, 7:08:22 AM11/14/21
to djongo
i'm trying to use django + djongo to have some DB..
And i'm not sure  if i'm doing it correctly at all.


I have Pic and mAlbum

Can i have something like this?
albums = models.ArrayReferenceField(null=True,)



class mAlbum(models.Model):
name = models.TextField(default="row-", max_length=255, unique=True)
about = models.TextField(default="about The Album", max_length=1000)
c_date = models.DateTimeField(auto_now=True)


class Pic(models.Model):
name = models.TextField(default="def_name", null=True, help_text="photo name (optional)")
techdata = models.EmbeddedField(
model_container=ImTechdata,
model_form_class=ImTechdata_Form
)
albums = models.ArrayReferenceField(
null=True,
related_name='mAlbum_mItem_set',
to=mAlbum,
on_delete=models.CASCADE,
)
headline = models.CharField(max_length=255)
objects = models.DjongoManager()

 
Reply all
Reply to author
Forward
0 new messages