Skip to content

Instantly share code, notes, and snippets.

@aballah-chamakh
Last active July 16, 2019 21:42
Show Gist options
  • Select an option

  • Save aballah-chamakh/fdebb0f0fb0e556db63aab17534325bc to your computer and use it in GitHub Desktop.

Select an option

Save aballah-chamakh/fdebb0f0fb0e556db63aab17534325bc to your computer and use it in GitHub Desktop.
from django.db import models
class Article(models.Model):
analytic = models.OneToOneField(on_delete=models.SET_NULL,null=Yrue)
title = models.CharField(max_length=255)
description = models.TextField()
def __str__(self):
return self.title
class Analytic(moodels.Model):
views = models.IntegerField()
def __str__(self):
return self.views
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment