Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
459 B
3
Indexable
Never
# views
---------------------
def index(request):
    event = Event.objects.all
    return render(request,'index.html',{'event':event})


models
-------------
from django.db import models

class Event(models.Model):
    title = models.CharField(max_length=250,unique=True,default=None)
    image = models.ImageField(upload_to='events')
    details = models.CharField(max_length=120,unique=True,default=None)

    def __str__(self):
        return self.title