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 7565667
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T14:12:48+00:00 2026-05-30T14:12:48+00:00

I try to save a m2m relation of a model. This ends up in

  • 0

I try to save a m2m relation of a model. This ends up in the model you see below. The error I get is:

save() got multiple values for keyword argument 'force_insert'

So to me it seems force_insert is passed both in args and kwargs. However when inspecting the values with pdb, I get the following: args = () and kwargs = {'force_insert': True, 'using': 'default'}. So force_insert is not present in args. Any ideas why this goes wrong?

class TaggedItem(GenericTaggedItemBase, TaggedItemBase):
    """
    Also caches team info when available.
    """
    team = models.ForeignKey(Team, null=True)

    def save(self, *args, **kwargs):
        if hasattr(self.content_object, 'team'):
            self.team = self.content_object.team

        import pdb; pdb.set_trace()

        super(TaggedItem, self).save(self, *args, **kwargs)

    class Meta:
        verbose_name = _("Tagged Item")
        verbose_name_plural = _("Tagged Items")

EDIT: As expected, if I delete ‘force_insert’ from kwargs the save does work.

Stacktrace:

D:\Stamkracht\v3\v3_env\lib\site-packages\django\core\handlers\base.py in get_response
                        response = callback(request, *callback_args, **callback_kwargs) ...

D:\Stamkracht\v3\backbone\utils.py in _decorated
        return view_func(request, *args, **kwargs) ...

D:\Stamkracht\v3\v3_env\lib\site-packages\annoying\decorators.py in wrapper
            output = function(request, *args, **kwargs) ...

D:\Stamkracht\v3\apps\blog\views.py in create
    return _handle_blog_form(request, blog) ...

D:\Stamkracht\v3\apps\blog\views.py in _handle_blog_form
            form.save_m2m() # Needed for tags! ...

D:\Stamkracht\v3\v3_env\lib\site-packages\django\forms\models.py in save_m2m
                f.save_form_data(instance, cleaned_data[f.name]) ...

D:\Stamkracht\v3\apps\taggit\managers.py in save_form_data
        getattr(instance, self.name).set(*value) ...

D:\Stamkracht\v3\apps\taggit\utils.py in inner
        return func(self, *args, **kwargs) ...

D:\Stamkracht\v3\apps\taggit\managers.py in set
        self.add(*tags) ...

D:\Stamkracht\v3\apps\taggit\utils.py in inner
        return func(self, *args, **kwargs) ...

D:\Stamkracht\v3\apps\taggit\managers.py in add
            self.through.objects.get_or_create(tag=tag, **self._lookup_kwargs()) ...

D:\Stamkracht\v3\v3_env\lib\site-packages\django\db\models\manager.py in get_or_create
        return self.get_query_set().get_or_create(**kwargs) ...

D:\Stamkracht\v3\v3_env\lib\site-packages\django\db\models\query.py in get_or_create
                obj.save(force_insert=True, using=self.db) ...

D:\Stamkracht\v3\apps\taggit\models.py in save
        super(TaggedItem, self).save(self, *args, **kwargs) ...
  • 1 1 Answer
  • 0 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-30T14:12:50+00:00Added an answer on May 30, 2026 at 2:12 pm

    You call to super is off. You shouldn’t be passing self into the method. That’s already covered by super. Use this instead:

    super(TaggedItem, self).save(*args, **kwargs)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Try loading this normal .jpg file in Internet Explorer 6.0. I get an error
When i try to save data to my model Doctrine throws this exception: Message:
I have this error when i try to save my entity: Invalid object name
When I try to save an entity I get an error: Object reference not
My model has a SlugField. When I try to save an instance of this
When I try to save a certain of my ActiveRecord instances, I get this
When I try and save something to my list in SharePoint I get the
according to this image, i try to save data in NSUserDefaults but my App
Hello my problem is i try to save a new relation between a shop
Try to save them like this: HttpCookie latcook = new HttpCookie(latitude, lat.Value.ToString()); HttpCookie lngcook

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.