class Message(models.Model):
date = models.DateField()
user = models.ForeignKey(UserEx)
groups = models.ManyToManyField(Group)
main_category = models.ForeignKey(MainCategories)
sub_category = models.ForeignKey(SubCategories)
I want dynamic filling of some of the fields. So, I’ve got some questions about it.
- How to get access to this fields? Obviously, default field of the
model won’t work with dynamic data (I tried to crate default field – no errors, no result). - How to filter groups? My user has the same field with groups, so I want allow him to edit and display messages only for that groups only.
Well, and last one question – maybe it’ll be more easy to create my own admin panel? But it’s really scary to think about realisation of sorting and displaying things, that are really comfort here, in admin panel.
You do that by overriding the ModelForm: