from django.db import models
from cloudinary.models import CloudinaryField

# Create your models here.

class Category(models.Model):
    name = models.CharField( max_length=200, null=False, blank=False ) 

    def __str__(self):
        return self.name
    
class Photo(models.Model):
    category = models.ForeignKey( Category, on_delete=models.SET_NULL, null=True, blank=True )
    image = CloudinaryField('image', default='')
    description = models.TextField() 

    def __str__(self):
        return self.description
[((7, 11, 7, 70), 'django.db.models.CharField', 'models.CharField', (), '', False, 'from django.db import models\n'), ((13, 15, 13, 94), 'django.db.models.ForeignKey', 'models.ForeignKey', (), '', False, 'from django.db import models\n'), ((14, 12, 14, 48), 'cloudinary.models.CloudinaryField', 'CloudinaryField', (), '', False, 'from cloudinary.models import CloudinaryField\n'), ((15, 18, 15, 36), 'django.db.models.TextField', 'models.TextField', ({}, {}), '()', False, 'from django.db import models\n')]