from django.db import models


class License(models.Model):
    name = models.CharField(max_length=80, unique=True)
    symbols = models.CharField(max_length=5)
    url = models.URLField(unique=True)

    def __unicode__(self):
        return self.name

    def get_absolute_url(self):
        return self.url

class Licensed(models.Model):
    license = models.ForeignKey(License)
    class Meta:
        abstract = True



from django.db import models


class License(models.Model):
    name = models.CharField(max_length=80, unique=True)
    symbols = models.CharField(max_length=5)
    url = models.URLField(unique=True)

    def __unicode__(self):
        return self.name

    def __str__(self):
        return self.name

    def get_absolute_url(self):
        return self.url

class Licensed(models.Model):
    license = models.ForeignKey(License)
    class Meta:
        abstract = True



Add __str__() method to license model
Add __str__() method to license model

__unicode__() is not used in python3

  from django.db import models
  
  
  class License(models.Model):
      name = models.CharField(max_length=80, unique=True)
      symbols = models.CharField(max_length=5)
      url = models.URLField(unique=True)
  
      def __unicode__(self):
+         return self.name
+ 
+     def __str__(self):
          return self.name
  
      def get_absolute_url(self):
          return self.url
  
  class Licensed(models.Model):
      license = models.ForeignKey(License)
      class Meta:
          abstract = True
  
  
  
Add __str__() method to license model
## Code Before:
from django.db import models


class License(models.Model):
    name = models.CharField(max_length=80, unique=True)
    symbols = models.CharField(max_length=5)
    url = models.URLField(unique=True)

    def __unicode__(self):
        return self.name

    def get_absolute_url(self):
        return self.url

class Licensed(models.Model):
    license = models.ForeignKey(License)
    class Meta:
        abstract = True



## Instruction:
Add __str__() method to license model
## Code After:
from django.db import models


class License(models.Model):
    name = models.CharField(max_length=80, unique=True)
    symbols = models.CharField(max_length=5)
    url = models.URLField(unique=True)

    def __unicode__(self):
        return self.name

    def __str__(self):
        return self.name

    def get_absolute_url(self):
        return self.url

class Licensed(models.Model):
    license = models.ForeignKey(License)
    class Meta:
        abstract = True


