title: Django Reverse Relation Serializer
body: <p>I am trying to create a project for self learning and right now, I am stuck at this point.</p>
  
  <p>Its an event planner and each event will have meat. Organizer of the event can select or create new meat types for his event. Once the event created, guests can select their preferred meat type from the selection pool which the organizer picked.</p>
  
  <p>For example, as an organizer I can say I will have "Chicken", "Turkey", and "Beef" from a <code>MeatType</code> table which has "Chicken", "Turkey" and "Pork" . (Organizer will create a new <code>MeatType</code> and select it for his event)</p>
  
  <p>So I have 3 Django model related for this specific problem.</p>
  
  <p><strong>Event model</strong>:</p>
  
  <pre><code>class Event(models.Model):
     name = models.CharField(_('Event name'), max_length=255)
     capacity = models.IntegerField(_('Capacity'), null=True)
     address = models.CharField(_('Address'), max_length=255)
     date = models.DateTimeField(_('Event Date'), db_index=True)
  
     organizer = models.ForeignKey(settings.AUTH_USER_MODEL, verbose_name=_('Organizer'), related_name='events',
                                on_delete=models.CASCADE)
  </code></pre>
  
  <p><strong>Meat Type model</strong>:</p>
  
  <pre><code>class MeatType(models.Model):
     """
     A model just to hold meat type names on the database.
     This model will only have a "name" field which represents the Meat Type.
     For example, "Chicken" or "Beef"
     """
     name = models.CharField(_('Name'), max_length=255)
  </code></pre>
  
  <p>and <strong>Available Meat Type Model</strong>:</p>
  
  <pre><code>class AvailableMeatType(models.Model):
      """
      Available meat types for the event selected by Organizer
      """
      event = models.ForeignKey(Event, verbose_name=_('Event'), related_name='available_meat_types',
                            on_delete=models.CASCADE)
      meat_type = models.ForeignKey(MeatType, verbose_name=_('Meat Type'), on_delete=models.CASCADE)
  </code></pre>
  
  <p>According to this structure, to create an event, organizer should send a request looking like this:</p>
  
  <pre><code>    {
         "name": "Team BBQ",
         "capacity": 10,
         "address": "Down Town",
         "date": "2019-02-01T18:00",
         "available_meat_type_ids": [
             1, 
             2, 
             3
         ]    
      }
  </code></pre>
  
  <p>Where 1 , 2 and 3 is the <code>Meat Type</code> ids but will create <code>Available Meat Type</code> objects like: { 123, 1 } , { 123, 2} , { 123, 3} where 123 is the created event id</p>
  
  <p>** My Serializers **</p>
  
  <pre><code>class EventSerializer(serializers.ModelSerializer):
      """
      A serializer class for creating and listing events
      """
      organizer = serializers.PrimaryKeyRelatedField(read_only=True)
      available_meat_type_ids = serializers.PrimaryKeyRelatedField(
      many=True,
      read_only=True
  )
  
      class Meta:
          model = Event
          fields = (
              'id',
              'name',
              'capacity',
              'address',
              'date',
              'organizer',
              'available_meat_type_ids'
          )
          read_only_fields = ('organizer', )
  
      def post(self, request, *args, **kwargs):
          """
          Create available meat type object
          """
          # I dont know what to do here
          pass
  
      @staticmethod
      def validate_date(date):
          # Date of the event can not be on the past
          if date &lt; timezone.now():
              raise Exception("Date of the new event can not be on the past.")
          return date
  
  
  class CreateAvailableMeatTypeSerializer(serializers.ModelSerializer):
      """
      A serializer for available meat type request.
      """
      event = serializers.PrimaryKeyRelatedField(required=True, queryset=Event.objects)
      meat_type = serializers.PrimaryKeyRelatedField(required=True, queryset=MeatType.objects)
  
      class Meta:
          model = AvailableMeatType
          fields = (
              'id',
          )
  </code></pre>
  
  <p>I dont know how to make it work. I tried to search online, but couldnt find anything that helps.</p>
  
  <p>How can I create available meat type objects from the meat type ids that I receive in Event creation request? </p>