Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Django Forms More on Models Multi-table Inheritance

Not for sure on what is wrong...

Amazing! OK, now let's add models for our Digital products.

Make a new model, Digital, that inherits from Product. Add a new field to it, url, that is an URLField.

products/models.py
from django.db import models

from . import models

class Product(models.Model):
    name = models.CharField(max_length=255)
    description = models.TextField()

class Digital(Product):
    url = models.URLField()

2 Answers

Hi marcolamoon, you have to imports with the same name,

from django.db import models

from . import models

from django.db import models

from . import models

A hotfix for this problem could be to change the name with the as operator, here's an example:

from names import user_first_name as first_name

But even with that, I don't see the reason you want to do

from . import models

in fact, I tried the code without that and everything worked out.

i also pasted your code and it passed