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

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/cae68835-1078-4a80-a8b8-e72e9b1372e2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to