Questions tagged [django-modeladmin]
132 questions
0
votes
0 answers
Restrict the deleted news with that group
The challenge is to:
There is a group which named as GroupEditor
User of this group( GroupEditor) can only Add , Change and Remove News- only News
But to do so user of this group(GroupEditor) when deleted news could delete your news which he…

Milad
- 1
- 2
0
votes
1 answer
ModelForm not showing in admin
I have an app called profile which has de model Profile(models.Model). Then, I have another app called offer with the model Offer(models.Model) and it has almost all the attributes of the Profile one, so I wanted to include a form with the…

bcap
- 500
- 5
- 14
0
votes
0 answers
Django Admin Custom View URL not being recognized
I am using Django 1.8 on Python 3.4.3
I have a Model called FormUpload and I am adding a ModelAdmin for the same in admins.py in the same application "mca".
@admin.register(FormUpload)
class FormUploadAdmin(admin.ModelAdmin):
def…

Vidyanand
- 967
- 8
- 14
0
votes
1 answer
Django formfield_for_foreignkey
I am trying to filter my admin choices in a foreign key field following the documentation.
My model is pretty simple:
class Page(models.Model):
title = models.CharField(max_length=50, null=False, blank=False, default="Title")
layout =…

cdvv7788
- 2,021
- 1
- 18
- 26
0
votes
1 answer
A foreign key field is not rendered inside an inline model admin in django
I'm creating a small site to register sporting event results. I have two following models:
Team
Player (of a team)
Match
Goals (scored by a Player on a Match)
in more detail:
class Team(models.Model):
name =…

Akasha
- 2,162
- 1
- 29
- 47
0
votes
0 answers
In django admin, how to get form data in custom method
I search to retrieve form data (in case of change view) in a ModelAdmin class custom method :
Here what i want to be able to do :
class MyModelAdmin(admin.ModelAdmin):
def custom_method(self):
pprint(self.data['myfield'])
I can't change…

fabien-michel
- 1,873
- 19
- 38
0
votes
2 answers
How to avoid ModelAdmin options being overridden in subclasses?
I have a generic ModelAdmin in my admin.py which replaces some widgets in the admin interface. It serves as a superclass for all my other ModelAdmins. It looks like this:
#in mainapp/admin.py:
from django.contrib import admin
from django.db import…

ksadowski
- 161
- 9
0
votes
1 answer
Django: conditional ModelAdmin depending on object
Let's say I have a base class with, for example:
class Base(models.Model):
name = models.CharField(max_length=50, blank=False, null=False)
value1 = models.CharField(max_length=50)
value2 = models.CharField(max_length=50)
Now, I'm…

paketep
- 53
- 6
0
votes
1 answer
save_formset for StackedInline not working
I am trying to generate a qr code to assign to an image field. I have done this with no trouble on another model, using the save_model function in ModelAdmin. Now, I need to do it in an Inline. Apparently, save_model does not work here, and I am…

Rowan Ingram
- 201
- 2
- 9
0
votes
1 answer
How may I overrride the ModelAdmin so that it displays components of two models?
I want to override the ModelAdmin. But I want to include the functionalities of two models into one. However I'm not considering merging the two models into one. Is there any other way in which I can override it and include the functionalities of…

Indradhanush Gupta
- 4,067
- 10
- 44
- 60
-1
votes
1 answer
Django - Calling ManytoMany Field inside jQuery
I am using Django Model field values inside a Javascript file by using the following code:
var action_type =$('#id_strength').val();
Here strength is a Charfield.
But the same doesn't work for a ManytoMany Field
var action_type…

Rahul R
- 1
- 1
-1
votes
1 answer
How to model my database relationships
I have searched a lot on this forum and also went through the docs before posting my question here , I am developing a fashion aggregator website to show outfits currently I am scraping my products from different websites and I am storing it in csv…

mohammad imran
- 65
- 3
- 9