Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Django Search Function inside ForeignKey #4

Open
khashashin opened this issue Aug 31, 2017 · 0 comments
Open

Django Search Function inside ForeignKey #4

khashashin opened this issue Aug 31, 2017 · 0 comments

Comments

@khashashin
Copy link
Owner

khashashin commented Aug 31, 2017

I have a class with huge amount of data and another class which should take the title value from this class.
How can I add a search function to ForeignKey as you can see in following Image. Or does Django have a way to solve this problem? Thanks!
I created a similar theme on stackoverflow

Search inside ForeignKey

class Menue(models.Model):
    title = models.CharField(max_length=255)
        panels = [
            FieldPanel('title', classname="col12"),
        ]
def __str__(self):
    return self.title

class Wochen(models.Model):
    menu_1 = models.ForeignKey(Menue,
        null=True, blank=True, on_delete=models.PROTECT, 
        related_name="menu_1+")
    panels = [
        FieldPanel('menu_1', classname="col12"),
    ]
def __str__(self):
    return self.menu_1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant