ly going out of business.
I think Whatsapp, Slack etc are all very appropriate places for private
conversations. Not so much for a user mutual-support mailing list like
this one.
Thanks for understanding
Cheers
Mike
On 5/01/2023 3:31 pm, Satyajit Barik wrote:
Yes. It does. ModelAdmin cla
Yes. It does. ModelAdmin classes can define list filters that appear in the
right sidebar of the change list page of the admin.
For more reference:
https://docs.djangoproject.com/en/4.1/ref/contrib/admin/filters/
For this topic related join our WhatsApp group: https://bit.ly/3oJtfcf
Regards
On 5/01/2023 5:43 am, Mario St-Gelais wrote:
Hello group, first post here.
Quick question. Can capabilities of ModelAdmin such as list_filter or
search_fields be used outside of the admin interface?
Have you looked at htmx?
https://www.simplecto.com/htmx-and-the-list_editable-in-django
Hello group, first post here.
Quick question. Can capabilities of ModelAdmin such as list_filter or
search_fields be used outside of the admin interface?
I want a view that would allow non logged users to search a site through
checkboxes and some search fields possibly and obviously, the way
Hello, I would like to know about this (although I hacked around it, but I
am still curious):
if I have model which contains ForeignKey attribute and I am using
autocomplete_fields on it, where is the found FK of foreign object saved on
ModelAdmin page?
Numerical ID of foreign object
Dne čtvrtek 4. března 2021 v 21:22:41 UTC+1 uživatel zvo...@seznam.cz
napsal:
> I want use Django 2+ autocomplete_fields.
> Adding them into (source) ModelAdmin will give lot of errors (see bellow).
> So I must add a (target) ModelAdmin with search_fields=...
>
> After that e
I want use Django 2+ autocomplete_fields.
Adding them into (source) ModelAdmin will give lot of errors (see bellow).
So I must add a (target) ModelAdmin with search_fields=...
After that everything works.
However I don't want to have such new ModelAdmin's visible/accessible.
I have dat
First correct email to email
On 24 Sep 2020 00:33, "coolguy" wrote:
> either use admin.site.register
> OR
> *@*admin.register(User)
>
> On Wednesday, September 23, 2020 at 11:01:43 AM UTC-4 kkwaq...@gmail.com
> wrote:
>
>> *models.py*
>>
>> [image: 1.jpg]
>>
>> *admin.py*
>>
>> *[image: 2.jpg]*
>
either use admin.site.register
OR
*@*admin.register(User)
On Wednesday, September 23, 2020 at 11:01:43 AM UTC-4 kkwaq...@gmail.com
wrote:
> *models.py*
>
> [image: 1.jpg]
>
> *admin.py*
>
> *[image: 2.jpg]*
>
> *errors*
>
>
> *[image: 3.jpg]*
>
> *Object is not callable*
>
> *Please any body sol
*models.py*
[image: 1.jpg]
*admin.py*
*[image: 2.jpg]*
*errors*
*[image: 3.jpg]*
*Object is not callable*
*Please any body solutions *
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emai
Using Django 1.8, I do not understand what is the behavior of `Media` [0]
inside a `ModelAdmin` subclass.
In particular, whether the default behavior of form's media is applied in
`ModelAdmin` that is: `extend=True` [1]
I am under the impression that the behavior is implement
I have a model which is registered to two different admin sites with two
ModelAdmins.
I would like to override the template for change_list_results for each
ModelAdmin independently. Currently it's not possible the same way you can
do it for add_form_template, change_form_template et
Hi,
I'm currently struggling with a custom ModelAdmin.
Karim
I haven't tried to fully understand your use case. However, this
is what I think your process could be if you do not wish to ajax
it ...
1. Override the model save() method to call a model meth
2019 9:46 pm, karim...@gmail.com wrote:
>
> Hi,
>
> I'm currently struggling with a custom ModelAdmin.
>
>
> Karim
>
> I haven't tried to fully understand your use case. However, this is what I
> think your process could be if you do not wish to ajax it
vendredi 1 mars 2019 00:06:40 UTC+1, Mike Dewhirst a écrit :
>
> On 28/02/2019 9:46 pm, karim...@gmail.com wrote:
>
> Hi,
>
> I'm currently struggling with a custom ModelAdmin.
>
>
> Karim
>
> I haven't tried to fully understand your use case. However, this is w
On 28/02/2019 9:46 pm,
karim.at...@gmail.com wrote:
Hi,
I'm currently struggling with a custom ModelAdmin.
Karim
I haven't tried to fully understand your use case. However, this is
what I
You maybe want a model admin view where you can send the user to and
collect the data you want to comare and show warnings
--
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
Hi,
I'm currently struggling with a custom ModelAdmin.
Considering the following model:
# Bloc fonctionnel
class Assembly(Item):
product = models.ForeignKey(to='ProductFamily', on_delete=models.CASCADE
, null=True, verbose_name=_('Famille Produit'))
functions
Hello!
Ordinary staff users on the main django admin module are just standard
django users that can access the admin site.
Setting the has_add_permission, has_change_permission and
has_delete_permission via the ModelAdmin should be done to customize the
permissions for specific object
I have simple project on Django 1.11.13, that uses ordinary Django's admin
module. Staff user can not delete object while is permitted
(has_delete_permission returns always true).
models.py:
class MyModel(models.Model):
name = models.IntegerField("Value", blank=True, null=True)
admin.py
James,
I was finally able to add extra fields to a ModelForm dynamically! Check
out the answer to this post -
https://stackoverflow.com/questions/32335349/how-do-i-create-and-save-dynamic-fields-in-django-modeladmin
It worked for me in django 2. I have not tried it in django 1.11.
I hope this
On 4/05/2018 7:02 AM, jt.oldn...@gmail.com wrote:
Thanks for the response Mike.
I generally don't like it when a design has to change to fit a framework,
I agree. My design is almost entirely in the models. I want an API to be
able to work without Django forms.
however, in this case I decid
Thanks for the response Mike.
I generally don't like it when a design has to change to fit a framework,
however, in this case I decided to try your solution. I ran into a couple
of problems though :-(
1) The fields that I'm looking up were required fields. Validation failed
and error messages
:-(. Forgive me if I screw up
the lingo.
I've got a ModelAdmin page for registrants of a conference which has
fields for Employee ID, Name, email etc. The registrant does not have
to be an employee, but if they are I could lookup their name, email
etc. from an external source (already have
On 3/05/2018 7:00 AM, jt.oldn...@gmail.com wrote:
I'm new to Django and web development in general (C++ background) and
I've got amazingly far very quickly, but there's one thing I've been
struggling with for a couple days now :-(. Forgive me if I screw up
the lingo.
I
I'm new to Django and web development in general (C++ background) and I've
got amazingly far very quickly, but there's one thing I've been struggling
with for a couple days now :-(. Forgive me if I screw up the lingo.
I've got a ModelAdmin page for registrants of a co
am running django 1.11.
>
> Thanks!
>
> Mark
>
> On Mon, Apr 30, 2018 at 1:41 AM, 'James Foley' via Django users <
> django...@googlegroups.com > wrote:
>
>> So, I have a ModelAdmin that I need to add extra fields to. These fields
>> do not exist
> So, I have a ModelAdmin that I need to add extra fields to. These fields
> do not exist on the model, but will be dynamically added to a custom
> ModelForm through the __init__ method, and logic inside clean will handle
> the returned data on save.
>
> I can't seem to find any sol
So, I have a ModelAdmin that I need to add extra fields to. These fields do
not exist on the model, but will be dynamically added to a custom ModelForm
through the __init__ method, and logic inside clean will handle the
returned data on save.
I can't seem to find any solid information re
UTC, Matt Schinckel wrote:
>
> On Jan 12, 4:11 am, Tomasz Zieliński
> wrote:
> > On 11 Sty, 16:23, Marco Rogers wrote:
> >
> > > I'm reposting this from earlier to see if I have better luck. I need
> > > to be able to get the ModelAdmin associated with a m
Checking through the documents I found the following reference:
https://docs.djangoproject.com/en/2.0/topics/forms/media/#order-of-assets
Changed in Django 2.0:
In older versions, the assets of Media objects are concatenated rather than
merged in a way that tries to preserve the relative orderin
because they are specific to only a few models, particularly the loading
scripts, and options, etc. this worked great in Django 1.11
On Sunday, 10 December 2017 09:36:56 UTC-5, Etienne Robillard wrote:
>
> Why don't you simply put the javascripts into your base template without
> using Python ?
Why don't you simply put the javascripts into your base template without
using Python ?
Etienne
Le 2017-12-10 à 09:30, Marc R a écrit :
I have this in my model:
class Media:
js = (
*'/static/plugins/codemirror/lib/codemirror.js',*
'/static/plugins/codemirror/mode/htmlmixed/htmlmixed.
I have this in my model:
class Media:
js = (
* '/static/plugins/codemirror/lib/codemirror.js',*
'/static/plugins/codemirror/mode/htmlmixed/htmlmixed.js',
'/static/plugins/codemirror/addon/fold/foldcode.js',
'/static/plugins/codemirror/addon/fo
I would like to create a mixin to extend the ModelAdmin class that adds a
description text to the view, overriding the default change_list_template.
[admin_extra.py]
class DescriptionAdminMixin(object)
change_list_template = "description_change_list.html"
...
def changelist
On Sep 16, 2016 1:46 AM, "Andrea D'Amore" wrote:
>
> On 16 September 2016 at 00:53, wrote:
> > I have a ModelAdmin subclass (code at: <https://dpaste.de/0LAt>)
>
> Gives a 404:
>
> The requested URL /0LAt was not found on this server.
>
&g
Apologies, I updated it.
class MyModelAdmin(ModelAdmin):
model = MyModel
form = MyForm
def get_form(self, request, obj=None, **kwargs):
form_class = super(MyModelAdmin, self).get_form(request, obj=obj,
**kwargs)
some_parameter_for_one_thing
On 16 September 2016 at 00:53, wrote:
> I have a ModelAdmin subclass (code at: <https://dpaste.de/0LAt>)
Gives a 404:
The requested URL /0LAt was not found on this server.
I'm missing the rationale of using an external paste service while
you're already using a tex
e. If you look through the
>> Trac tickets you might find something related. However, your subclass where
>> you store "self.instance" on ModelAdmin is a no no due to thread safety.
>> See
>> http://stackoverflow.com/questions/3388111/modeladmin-thread-safety-cac
> tickets you might find something related. However, your subclass where you
> store "self.instance" on ModelAdmin is a no no due to thread safety. See
> http://stackoverflow.com/questions/3388111/modeladmin-thread-safety-caching-issues
>
> for an explanation.
>
&g
27;m all ears!
T
On Thursday, September 15, 2016 at 5:34:50 PM UTC-7, Tim Graham wrote:
>
> I think these ideas have been floated before. If you look through the Trac
> tickets you might find something related. However, your subclass where you
> store "self.instance" on Mod
I think these ideas have been floated before. If you look through the Trac
tickets you might find something related. However, your subclass where you
store "self.instance" on ModelAdmin is a no no due to thread safety. See
http://stackoverflow.com/questions/3388111/modeladmin-thr
I have a ModelAdmin subclass (code at: <https://dpaste.de/0LAt>) and I need
to do a couple of things, but the functionality seems to be missing:
1. I need to access the model instance to perform some initialization, but
there's no instance member set. There are a few questions on Sta
El jueves, 14 de julio de 2016, 17:29:38 (UTC+2), Bernat Bonet escribió:
>
> I need to add dynamic fields to ModelAdmin that are not part of the Model.
>
> Models:
>
> product: cod, des
> product_categories: cat, val
>
> I want to add val1, val2 in ProductAdmin
>
&g
you want to do)
On Thursday, 14 July 2016 17:29:38 UTC+2, Bernat Bonet wrote:
>
> I need to add dynamic fields to ModelAdmin that are not part of the Model.
>
> Models:
>
> product: cod, des
> product_categories: cat, val
>
> I want to add val1, val2 in ProductAdmin
>
&g
I need to add dynamic fields to ModelAdmin fieldset that are not part of
Model.
This field is to show or hide certain fields.
How can I do this?
Thanks
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this grou
I need to add dynamic fields to ModelAdmin that are not part of the Model.
Models:
product: cod, des
product_categories: cat, val
I want to add val1, val2 in ProductAdmin
Thanks
--
You received this message because you are subscribed to the Google Groups
"Django users"
I want to add placeholder to search bar .First,I override the template
change_list.html and find the search bar ,I know add attribute
placeholder ,and I defined a variable placeholder={{'''search_tip'}}
to placeholder, as my app has three searchbar in different modelAdmin, I
I want to add placeholder to search bar .First,I override the template
change_list.html and find the search bar ,I know add attribute
placeholder ,and I defined a variable placeholder={{'''search_tip'}}to
placeholder, as my app has three searchbar in different modelAdmin, I
Hi Malcolm,
> With the patch to check an instance rather than a class, perhaps I should
extend the checks to check the result of get_readonly_fields() rather than
just obj.readonly_fields. What do you think?
I think the checks should be run statically against ModelAdmin instances,
that
Hi Simon,
On Thursday, 10 September 2015 16:57:51 UTC+1, Simon Charette wrote:
>
> Hi Malcolm,
>
> > The system check checks that all the values returned from
> get_readonly_fields exist as class attributes on the ModelAdmin (or are
> callable/fields on model, neither of wh
Hi Malcolm,
> The system check checks that all the values returned from
get_readonly_fields exist as class attributes on the ModelAdmin (or are
callable/fields on model, neither of which helps here). With them being
created via __getattr__, they don't.
There might be something else
t_readonly_fields exist as class attributes on the ModelAdmin (or are
> callable/fields on model, neither of which helps here). With them being
> created via __getattr__, they don't.
>
> I'm coming to the conclusion that the right behaviour is to run the system
> check ag
Hi Simon,
I've tried that, and it still fails the same system check.
The system check checks that all the values returned from
get_readonly_fields exist as class attributes on the ModelAdmin (or are
callable/fields on model, neither of which helps here). With them being
created via __geta
rder of fields to be maintained somehow.
> I therefore suspect that the check is actually borked, and it should be
checking hasattr(instance, field_name) rather than hasattr(cls, field_name)
The thing is checks are run against ModelAdmin classes and not the
instances bound to the site they wer
#x27;, 'image_thumbnail']
def image_thumbnail(self, obj):
return "" % obj.image.url
That's fine, but if there's lots of image fields (with a variety of names)
spread over several ModelAdmin classes, then you end up with a lot of
duplicated code. The normal solution
i 8 septembre 2015 13:31:47 UTC-4, Malcolm Box a écrit :
>
> Hi,
>
> I'm trying to add a dynamic method to a ModelAdmin so that I can have
> automatically generated thumbnail fields for any image by simply adding
> '_thumbnail' to the field definitions - which
Hi,
I'm trying to add a dynamic method to a ModelAdmin so that I can have
automatically generated thumbnail fields for any image by simply adding
'_thumbnail' to the field definitions - which saves a lot of
code when there's a load of admin classes with image fields that ne
Dear All,
In a ModelAdmin object, how to reference the formset class of the
inline?
--
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-user
Is it safe to set a modeladmin variable and use it like this; it is set in
the changelist_view based on the url search criteria and is used to limit
the choices of a foreign key when adding new item
class MyModelAdmin(reversion.VersionAdmin):
...
selected_period = None
def
djangoproject.com/en/dev/ref/signals/#django.db.models.signals.pre_save
Many thanks for your reply!
While I seem to understand signals generally, I followed Collin's
suggestion, because the ModelAdmin class already has so many readily
available customization callbacks, so that this even
Hi Collin,
Am 20.12.2014 um 00:18 schrieb Collin Anderson:
save_model() happens first, then save_related() which
calls save_formset() on each formset.
It might end up being easier to save the parent model _again_, instead
of doing something before it's saved.
Thank you very much for your repl
On 18/12/14 17:19, Carsten Fuchs wrote:
> I would like to find out if anything has changed in the parent
> model or the related (inline) models, and depending on the result,
> update one of the parent model's fields before it is saved.
>
> Can you please tell me how can this be achieved?
Take a
https://docs.djangoproject.com/en/dev/ref/forms/fields/#has-changed
Collin
On Thursday, December 18, 2014 12:20:34 PM UTC-5, Carsten Fuchs wrote:
>
> Hi fellow Django developers,
>
> using a model with several related models, for the Django Admin I have a
> ModelAdmin that uses several Inli
Hi fellow Django developers,
using a model with several related models, for the Django Admin I have a
ModelAdmin that uses several InlineModelAdmin objects, very much as in
the example at
<https://docs.djangoproject.com/en/1.7/ref/contrib/admin/#inlinemodeladmin-objects>.
All work
h registered ModelAdmin once at
> registration time.[1] The default AdminSite itself is a module global.
> Thus, any long-running, multi-threaded Django application server (e.g. a
> threaded uWSGI process) might be relying on a given ModelAdmin instance to
> serve multiple requests concurr
> Your analysis is entirely correct, as far as I can tell. Setting
> attributes on `self` in a per-request method of a `ModelAdmin` is not
> concurrency-safe, and it should not be recommended or demonstrated in
> the docs. If you'd be willing to file a bug (or, better, a
Hi Peter,
On 11/12/2014 10:59 PM, Peter Sagerson wrote:
> I agree that setting self.exclude will set the instance attribute,
> thus hiding the class attribute of the same name. However, it appears
> that a given AdminSite instantiates each registered ModelAdmin once
> at registration
I agree that setting self.exclude will set the instance attribute, thus hiding
the class attribute of the same name. However, it appears that a given
AdminSite instantiates each registered ModelAdmin once at registration time.[1]
The default AdminSite itself is a module global. Thus, any long
On Tuesday, November 11, 2014 3:24:48 PM UTC-5, Peter Sagerson wrote:
>
> The documentation of ModelAdmin.get_form()[1] demonstrates modifying
> self.exclude in order to modify the add/change form on a per-request basis.
> However, looking at django.contrib.admin, it seems clear tha
The documentation of ModelAdmin.get_form()[1] demonstrates modifying
self.exclude in order to modify the add/change form on a per-request basis.
However, looking at django.contrib.admin, it seems clear that ModelAdmin is
instantiated when it's installed, not for every request. It also do
Thanks Collin. That's the path I've had to take.
On 03/11/2014 11:55 am, "Collin Anderson" wrote:
> Hi Mario,
>
> If you are able to edit the model replacing the IntegerField with this
> should do what you want:
> user = models.ForeignKey(CRMUser, null=True, blank=True,
> on_delete=DO_NOTHING)
>
Hi Mario,
If you are able to edit the model replacing the IntegerField with this
should do what you want:
user = models.ForeignKey(CRMUser, null=True, blank=True,
on_delete=DO_NOTHING)
Collin
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
T
Here's the models code, DR:
class CRMUser(AbstractBaseUser, PermissionsMixin):
email = models.EmailField(
verbose_name='Email Address',
max_length=255,
unique=True,
)
first_name = models.CharField("First Name", max_length=50, blank=True)
last_name = models.C
I did not produce the original model so I wouldn't know. My thinking is
that the order model had to be independent of the user model so that the
deletion of the user doesn't cascade down to orders. It's a mezzanine site
and that's how it handles fk from orders to users.
On 29/10/2014 9:27 pm, "Dani
On Wednesday, 29 October 2014 03:57:36 UTC, somecallitblues wrote:
>
> Hi list,
>
> I have a table of orders where one of the columns is a IntegerField
> containing the id of a user who created the order.
>
> Since it's not a FK field django admin can't display these orders inline
> inside the u
Hi list,
I have a table of orders where one of the columns is a IntegerField
containing the id of a user who created the order.
Since it's not a FK field django admin can't display these orders inline
inside the user details page.
I would normally use something like:
class OrderInline(admin.Tab
Hi,
Have you had any solutions to this yet?
--
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, sen
In the ModelAdmin I use a get_form() to test for conditions on the object.
Specifically, if this item has been published then make it read_only. You
should be able to test for users as well.
I had to add the try/except in order to add new objects because
obj.published doesn't exist on
It's easy, if you don't insist on making it part of the admin, to do this
with a custom view. It can pay attention to whatever permissions you like.
On Wed, Oct 9, 2013 at 10:06 AM, Victor wrote:
> Yes, I know but unfortunately if in Admin Site you say that a user cannot
> Add, Delete, and Mod
Yes, I know but unfortunately if in Admin Site you say that a user cannot Add,
Delete, and Modify a model if that user is connected he/she doesn't see the
model itself in the list but only those models for which it has some kind of
permission. I instead would like to make the model visible but n
In Admin Site, you can manage users permissions for Add, Delete, Modify of
every model on your site.
2013/10/9 Vittorio
> For the sake of simplicity let's suppose I have
>
> models.py
>
> class Book(models.Model):
> title = models.CharField(max_length=100)
> authors = models.ManyToManyF
For the sake of simplicity let's suppose I have
models.py
class Book(models.Model):
title = models.CharField(max_length=100)
authors = models.ManyToManyField(Author)
publisher = models.ForeignKey(Publisher)
Under admin I would like that some username (say "vic" and "lucky") can edit
I can not for the life of me figure out why my list_display works when the
django server is in DEBUG=True but not when it is in DEBUG=False. I am
using Django 1.4.3 (mod_wsgi 3.4/Python 2.7)
Here is the partial stack trace...
File
"/home/difuzi0n/webapps/wedding/lib/python2.7/django/db/m
elForm?
>>
>> The thing is that I have a Verification model with its ModelAdmin, and
>> then I have
>> an ImageModel that has no ForeignKey to the Verification model (and I
>> intend to keep
>> it that way) so I can not inline it into the VerificationAdmin and I
>
orm?
>
> The thing is that I have a Verification model with its ModelAdmin, and
> then I have
> an ImageModel that has no ForeignKey to the Verification model (and I
> intend to keep
> it that way) so I can not inline it into the VerificationAdmin and I would
> like
Hi,
As the subject states, is there a way to display a model formset in a
ModelForm?
The thing is that I have a Verification model with its ModelAdmin, and then
I have
an ImageModel that has no ForeignKey to the Verification model (and I
intend to keep
it that way) so I can not inline it into
I have a ModelAdmin class.
Sometimes, I want it to include a certain field in the fieldsets, and sometimes
I don't (whether it does or not would be the result of a calculation on the
instance that is being edited in the admin).
How can I make the fieldsets attribute a calculated
rom, but
> > when I try to
> > add this fields into the fieldset attribute and load the page it fails
> > saying.
>
> Sorry to say this, but you have to go back to the drawing board. You
> cannot add random fields to fieldset. They *have* to be models.Field
> cla
nd load the page it fails
> saying.
Sorry to say this, but you have to go back to the drawing board. You
cannot add random fields to fieldset. They *have* to be models.Field
classes of the model attached the ModelAdmin so that the values get
cleaned properly.
If you want extra fields for the form,
Hi, I've been struggling with dynamic forms and until now I'm loosing the
battle :S
The thing is that I have a HomeAdmin(ModelAdmin) that uses the form
HomeAdminForm(ModelForm)
The HomeAdminForm redefines the __init__ method to add a bunch a of hidden
input fields like this :
class Hom
Hello,
i have a little question which i could'nt answer myself reading the
documentation.
i'm trying to modify the modelAdmin of my "Picture"-model
this is what i'm trying to do:
class PictureAdmin(admin.ModelAdmin):
def save_model(self, request, obj, fo
In a view, I need to get a modeladmin for a model provided
dynamically, change some of the attributes of the modeladmin ( add an
aggregated field to the queryset, order the queryset by that field and
add a column for that new field in the list_display of the modeladmin
) and render the request
Hi Alireza,
Yes, that did the trick!
Thank you,
Paulo
On Thursday, June 14, 2012 2:26:46 PM UTC+1, Alireza Savand wrote:
>
>
>
> On Thursday, June 14, 2012 3:04:54 PM UTC+4, Paulo Almeida wrote:
>>
>> Hi,
>>
>> I would like to access the request.user in
And if it's just for logged-in user, you can
do like
https://gist.github.com/2930287
at the ModelAdmin
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To view this discussion on the web visit
https://groups.google.com/d/m
On Thursday, June 14, 2012 3:04:54 PM UTC+4, Paulo Almeida wrote:
>
> Hi,
>
> I would like to access the request.user in a ModelAdmin function, so I can
> filter the results of a query based on the logged in user. I have these
> models:
>
> class Speaker(m
ogled around and saw solutions for similar
>> > problems involving overrides of save_model, queryset or
>> > formfield_for_manytomany, but I couldn't adapt them to list_display,
>> > because I'm creating a function in the ModelAdmin, where I only know
>>
k because request isn't available in
> the
> > is_endorsed function. I googled around and saw solutions for similar
> > problems involving overrides of save_model, queryset or
> > formfield_for_manytomany, but I couldn't adapt them to list_display,
> > beca
he
> is_endorsed function. I googled around and saw solutions for similar
> problems involving overrides of save_model, queryset or
> formfield_for_manytomany, but I couldn't adapt them to list_display,
> because I'm creating a function in the ModelAdmin, where I only kno
Hi,
I would like to access the request.user in a ModelAdmin function, so I can
filter the results of a query based on the logged in user. I have these
models:
class Speaker(models.Model):
name = models.CharField(max_length=50)
endorsements = models.ManyToManyField(User
1 - 100 of 248 matches
Mail list logo