So my problem is I'm currently creating a Django site to keep track of events in various venues for my local community. I've set up all the basics of the site however I've got to the point where I have a seperate venues and event models.
Now I'd like it so when you select add event you get a selection of current venues where it would be hosted so I'd need to somehow link the models. I'm rather new to Django so went googleing for the answer but came up blank.
My current models look like:
Event:
from django.db import models
class Event(models.Model):
venue = models.CharField(max_length=200)
date = models.CharField(max_length=200)
Venues:
from django.db import models
class Venue(models.Model):
address1 = models.CharField(max_length=200)
address2 = models.CharField(max_length=200)
postcode = models.CharField(max_length=15)
email = models.CharField(max_length=200)
tel = models.CharField(max_length = 15)
So Ideally I'd like to get the venue from Event to link to the Venues model somehow, just wondering how I'd go about doing that?
Many Thanks!