I am trying to give add to the django permissions when you add a Type to a Source with the following models.py I would like it to be
from __future__ import unicode_literals
from django.db import models
"""Class for Data Sources"""
class Source(models.Model):
display_name = models.CharField(max_length=20)
code_name = models.CharField(max_length=20)
def __unicode__(self):
return self.display_name
list_display = ['display_name', 'code_name', ]
search_fields = ['display_name', 'code_name', ]
""" Class for Data Types"""
class Type(models.Model):
display_name = models.CharField(max_length=20)
code_name = models.CharField(max_length=20)
data_sources = models.ManyToManyField(DataSource)
for data_source in data_sources:
def __unicode__(self):
return self.display_name
list_display = ['display_name', 'code_name', ]
search_fields = ['display_name', 'code_name', ]
Do I need to have a views.py? I would like it to be
auth|permsission|type
Thanks in advance