models

31 views
Skip to first unread message

ngangsia akumbo

unread,
Jun 28, 2014, 5:22:30 AM6/28/14
to django...@googlegroups.com
please what can go within these models

page, events, news,  offers,  room types, services
Message has been deleted

Dean

unread,
Jul 5, 2014, 10:30:25 PM7/5/14
to django...@googlegroups.com
You could start here http://www.djangobook.com/en/2.0/chapter05.html and look at a 1/3 down the page at the heading 'Your First Model'.

Taking 'events' as an example, think about the data you need to record. For example, each event normally has a title, location, start date and time, end date and time and perhaps a link to the promoters main website, where the event is featured. As a rough example:

class NgangsiaEvent(models.Model):
    title = models.CharField(max_length=100)
    location = models.CharField(max_length=75)
    starting = models.DateTimeField(auto_now=False, auto_now_add=False)
it_ending = = models.DateTimeField(auto_now=False, auto_now_add=False)
website = models.URLField()

Hope that helps!
Reply all
Reply to author
Forward
0 new messages