Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 862849
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T09:12:40+00:00 2026-05-15T09:12:40+00:00

If I have two models like class Author(models.Model): name = models.CharField(max_length=100) title = models.CharField(max_length=3,

  • 0

If I have two models like

class Author(models.Model):
    name = models.CharField(max_length=100)
    title = models.CharField(max_length=3, choices=TITLE_CHOICES)
    birth_date = models.DateField(blank=True, null=True)

    def __unicode__(self):
        return self.name

class Book(models.Model):
    name = models.CharField(max_length=100)
    authors = models.ManyToManyField(Author)

I can render the book form using a model form like this

class BookForm(ModelForm):
    class Meta:
        model = Book

        widgets = {
            'authors' : TextInput()
        }

The authors fields is now rendered as a text box and I want to use an auto complete (where I can enter multiple authors) text box to populate the field.

I am having a hard time to understand how I can save the authors in view function? I am thinking of using a hidden field to record all the author id’s but I am having a hard time figuring out how to save it on the postback.

  • 1 1 Answer
  • 3 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T09:12:41+00:00Added an answer on May 15, 2026 at 9:12 am

    http://djangosnippets.org/snippets/1365/
    http://code.google.com/p/django-ajax-selects/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two models like this: class Store(models.Model): name = models.CharField(max_length=255) class Order(models.Model): store
I have two models like so: class Visit(models.Model): id = models.AutoField(primary_key=True) name = models.CharField(max_length=65535,
Let's say I have two models looking like this: class ProductType(models.Model): product_type = models.CharField(max_length=100)
I have two models with slug fields: class Book(models.Model): name = models.CharField(max_length=200) slug =
I currently have this chunk of model code: class Book(models.Model): title = models.CharField(max_length=100) num_pages
I have two models: class Studio(models.Model): name = models.CharField(Studio, max_length=30, unique=True) class Film(models.Model): studio
I've got two models like these: class Schedule(models.Model): name = models.CharField(_('name'), blank=True, max_length=15) class
I have two models like this: class AA(models.Model): name = models.CharField() state = models.IngerField()
Say I have two models in my Django project. class Project(models.Model): name = models.CharField(max_length=256)
I have two models , Task and TaskComment : class Task(models.Model): title = models.CharField(max_length

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.