as I can use two in a meta model class, when I run it I get an error How I can use the models? It is an example of Django Rest
from rest_framework import serializers
from .models import Post,Miembros
class PostSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Post
fields = ('id', 'url', 'titulo', 'contenido','fecha_evento','fecha_evento','banner_grande','lugar')
model = Miembros
fields = '__all__'
TypeError at /api/posts/ The
fields
option must be a list or tuple. Got str. Request Method: GET Request URL: http://127.0.0.1:8000/api/posts/ Django Version: 1.8.3 Exception Type: TypeError Exception Value: Thefields
option must be a list or tuple. Got str. Exception Location: /home/root-master/restcosolg/cslg/local/lib/python2.7/site-packages/rest_framework/serializers.py in get_field_names, line 900 Python Executable: /home/root-master/restcosolg/cslg/bin/python Python Version: 2.7.6