Using wrong model?
See original GitHub issueHi, please tell me what I’m doing wrong as I’m trying to use this awesome library in one of my project and have issue. I’m running on Django 1.10 with django-rest-framework 3.5 (Python 3.5), and I have something like this:
class Company(models.Model):
name = models.CharField(max_length=255)
class Category(models.Model):
company = models.ForeignKey(Company)
class Project(models.Model):
company = models.ForeignKey(Company)
category = ChainedForeignKey(
to=Category,
chained_field="company",
chained_model_field="company"
)
This is something I want to use on Admin Form, in Project view.
The problem is, that Category shows all Projects, instead of Categories filtered by Companies. As I’ve took a look, there is because widget get model name from meta which is Project
.
Is there any possiblity to control this? Or did I just misused this somehow?
Thanks in advance!
The admin part is:
@register(Project)
class ProjectAdmin(ModelAdmin):
fieldsets = (
(None, {
'fields': (
('company',),
('category',),
)
}),
)
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Consequence of Selecting wrong model? - Cross Validated
What is the consequence of using an ordinary linear regression model while a linear mixed effect model is appropriate? Will the estimates and ......
Read more >How to Choose the Wrong Model - Biostatistics
What are the 10 best ways to choose the wrong model? ... Statistical inference: use data and the statistical model to make statements...
Read more >Passing wrong model into partial - razor - Stack Overflow
I am building my first web app with .net core razor pages. I am trying to move my menu to be partial, so...
Read more >Fitting the wrong model - Jorge Cimentada
Fitting the wrong model: suppose you have 100 data points that arose from the following model: y = 3 + 0.1×1 + 0.5×2...
Read more >Using the Wrong Model Can Lead to Unsupported ...
Granted that interferences are difficult to model, but a survey has shown that they are a significant source of clinician complaints about ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Same problem with latest version (1.2.5 from pypi). With 1.2.4 all fine
Seems to be working now! Thanks! I’ve used the newest version from PyPI.