from django.db import models

# Create your models here.

from django.db import models


class UserPost(models.Model):
    text = models.TextField(max_length=200)
    date_added = models.DateTimeField(auto_now_add=True)
    author = models.CharField(default='Eau De Web', max_length=20)

    def __unicode__(self):
        return '{} @ {}'.format(self.author, self.date_added)

Write a model class for user posts.
Write a model class for user posts.

  from django.db import models
  
- # Create your models here.
  
+ class UserPost(models.Model):
+     text = models.TextField(max_length=200)
+     date_added = models.DateTimeField(auto_now_add=True)
+     author = models.CharField(default='Eau De Web', max_length=20)
+ 
+     def __unicode__(self):
+         return '{} @ {}'.format(self.author, self.date_added)
+ 
Write a model class for user posts.
## Code Before:
from django.db import models

# Create your models here.

## Instruction:
Write a model class for user posts.
## Code After:
from django.db import models


class UserPost(models.Model):
    text = models.TextField(max_length=200)
    date_added = models.DateTimeField(auto_now_add=True)
    author = models.CharField(default='Eau De Web', max_length=20)

    def __unicode__(self):
        return '{} @ {}'.format(self.author, self.date_added)
