Lazaron Shyta
Lazaron Shyta

Reputation: 77

Why models.EmbeddedModelField is not working with djongo/django?

I have class Dimension and Feature. ( Want to create an Embedded Model from Feature to Dimension)

Documentation: bottom of page

I keep getting the error:

dimension = models.EmbeddedModel

AttributeError: module 'djongo.models' has no attribute 'EmbeddedModel'

class Dimension(models.Model):

    dimensionName = models.CharField(max_length=20)
    def __str__(self):
        return self.dimensionName


class Feature(models.Model):

    featureName = models.CharField(max_length=20)
    dimension = models.EmbeddedModel(
        model_container=Dimension,
    )
    def __str__(self):
        return self.featureName

Any leads would be appreciated!

Upvotes: 0

Views: 878

Answers (1)

Victor
Victor

Reputation: 2909

Use djongo.models.EmbeddedField (for djongo==1.3.1) or djongo.models.EmbeddedModelField for (djongo==1.2.23)

Upvotes: 2

Related Questions