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

  • Home
  • SEARCH
  • 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 244523
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T21:00:43+00:00 2026-05-11T21:00:43+00:00

I have made a inline named as Fooinline. This inline was working fine in

  • 0

I have made a inline named as Fooinline. This inline was working fine in Django 1.02 but as soon as I upgraded to Django 1.1 it started giving an error:

**TypeError at /admin/casd/aaas/4028cb901dd9720a011deadd85e8007f/
__init__() got an unexpected keyword argument 'request'**

My Fooinline code is:

class FooInline(InlineModelAdmin):

 template = 'admin/edit_inline/tabular2.html'

 def formfield_for_dbfield(self,db_field, **kwargs):
#    if isinstance(db_field, (models.ForeignKey, models.ManyToManyField)):
#        BaseModelAdmin.formfield_for_dbfield(self, db_field, **kwargs)
#    else:
     kwargs['widget'] = FlatTextWidget
     return db_field.formfield(**kwargs)

And my FlatTextWidget is

class FlatTextWidget(HiddenInput):
 def __init__(self, attrs=None):
     if attrs is not None:
         self.attrs = attrs.copy()
         super(Widget, self).__init__(attrs)
     else:
         self.attrs = {}
         super(Widget, self).__init__()

def render(self, name, value, attrs=None):
    real_field = super(HiddenInput, self).render(name, value, attrs)
    x = value
    if x is None:
        x = ''
    return mark_safe( '%s%s' % (real_field, x) )

def _has_changed(self, initial, data):
    return False

I am calling my Fooinline as

 class XYZInline(Fooinline):
    model=XYZ
  • 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-11T21:00:43+00:00Added an answer on May 11, 2026 at 9:00 pm

    The error is in your formfield_for_dbfield, it should read:

    def formfield_for_dbfield(self, db_field, **kwargs):
        kwargs['widget'] = FlatTextWidget
        return super(FooInline, self).formfield_for_dbfield(db_field,**kwargs)
    

    Take a look at the original function in contrib/admin/options.py#L71

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

Sidebar

Ask A Question

Stats

  • Questions 168k
  • Answers 168k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I would start here: http://en.wikipedia.org/wiki/Longest_common_substring_problem There are links to supplemental… May 12, 2026 at 1:38 pm
  • Editorial Team
    Editorial Team added an answer You'll have to do an InvokeSet("WAMUserName", new Object[] { "username"… May 12, 2026 at 1:38 pm
  • Editorial Team
    Editorial Team added an answer You could use validate to define your own validations. For… May 12, 2026 at 1:38 pm

Related Questions

I would like emacs to mark files that are generated as read-only when they're
I have made a list based navigation bar for my newest project and I
I have a PHP page, in Wordpress. When I add a inline Thickbox to
We have been looking at g++ versions 3.2.3 and 4.2.4. With 4.2.4, the performance

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.