On Wed, Nov 18, 2015, at 07:15, Victor wrote:
> Dear experts,
>
> models.py
>
> class Book(models.Model):
> title = models.CharField(max_length=100)
> author = models.CharField(max_length=100)
> quantity = models.IntegerField(db_column='quantitity',default=0)
> class Meta:
>
These three references should get you started.
get_queryset[1] is useful for filtering the entire display based on the
request user.
readonly_fields[2] is a simple list of fields which are readonly for
everyone.
get_readonly_fields[3] is an Admin callable which can be overridden by
your
While Jani's admonishments might be considered 'best practice' in some
cases. Those do not always cover everyone's use case.
I solved a similar issue allowing users with the superuser role to have
edit access to some items that other staff do not have access to edit.
Use the get_form method of
Hi,
In general you shouldn't be even trying to do this in admin since it's
not designed for this kind of functionality.
Admin is just a datacentric tool to view your data. It's never been
meant to help implementing any businesslogic. And basically you only
should let people in admin that
Dear experts,
models.py
class Book(models.Model):
title = models.CharField(max_length=100)
author = models.CharField(max_length=100)
quantity = models.IntegerField(db_column='quantitity',default=0)
class Meta:
db_table="book"
admin.py
class BookOption(admin.ModelAdmin):
5 matches
Mail list logo