Take a look at django permissions/groups models where you can make groups 
and put these models in each group. After that you add the users to the 
group so they can only edit models in that group

On Monday, May 13, 2019 at 9:30:08 AM UTC+2, Balaji Shetty wrote:
>
> Hi
> Consider the demo Example
>
> models.py
>
>
>
> *from django.db import models
>
> class Musician(models.Model):
>     first_name = models.CharField(max_length=50)
>     last_name = models.CharField(max_length=50)
>     instrument = models.CharField(max_length=100)
>
> class Album(models.Model):
>     artist = models.ForeignKey(Musician, on_delete=models.CASCADE)
>     name = models.CharField(max_length=100)
>     release_date = models.DateField()
>     num_stars = models.IntegerField()*
>
> *class Fan(models.Model):
>     artist = models.ForeignKey(Musician, on_delete=models.CASCADE)
>     Conutry = models.CharField(max_length=100)
>     **Name = models.CharField(max_length=100)
>     *
>
> Here We have to keep Track of Musician Album as well as all Fan/Follower 
> of respective Musician.
>
>
> Admin.py
>
>
>
> *class AlbumInline(admin.TabularInline):
>     model = Album*
>
> *class FanInline(admin.TabularInline):
>     model = Fan*
>
>
> class MusicianAdmin(admin.ModelAdmin):
>
>     inlines = [*AlbumInline,FanInline *, ]
>
> # code to register these 3 models
> ---------------------------------------------
>
> I have seperate Login User Account for Album 
> I have seperate Login User Accpunt for Fan 
>
>
> *My Question is*
>
>
> *I want to add only Album record in Album Login Account*
>
>
>
> *I want to add only Fan Record in Fan Login Account*
>
>
> *Currently *
> *In both login, Album and Fan Records can be added.  How cam i restrict 
> these?*
>
> -- 
>
>
> *Mr. Shetty Balaji S.Asst. ProfessorDepartment of Information Technology,*
> *SGGS Institute of Engineering & Technology, Vishnupuri, Nanded.MH.India*
> *Official: bssh...@sggs.ac.in <javascript:> *
> *  Mobile: +91-9270696267*
>
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/e4a2ad0a-901c-4862-b313-9492783628cb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to