Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » Django
  • » unexpected keyword argument 'member_name' (rev 1547) [RSS Feed]

#1 Dec. 5, 2005 10:45:41

E.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

unexpected keyword argument 'member_name' (rev 1547)


Hi,
today I upgraded to SVN version 1547, but when running admin interface
I got this while adding an instance of a model ('ddt' model):
----
TypeError at /admin/koan/ddt/add/
__init__() got an unexpected keyword argument 'member_name'
Request Method: GET
Request URL:http://127.0.0.1:8000/admin/koan/ddt/add/Exception Type: TypeError
Exception Value: __init__() got an unexpected keyword argument
'member_name'
Exception Location:
/usr/local/lib/python2.4/site-packages/django/core/meta/fields.py in
get_manipulator_fields, line 293
----
Note that everything worked fine before upgrading, both with release
0.90 (fixing differences in handling passwords) and with previous SVN
version (I'm sorry but I don't remember the exact version number I
had). Consider that this is the only model which gives me problems. I
also tried to switch back to 0.90 again and it worked fine.

I'm trying to inspect the problem using the beautiful debug mode with
all variables contents etc., but right now I'm not able to understand
the real nature of the problem.

Here is the ddt model generating errors (sorry, variable's names are in
Italian :) :
"""
class DDT(meta.Model):
cantiere = meta.ForeignKey(Cantiere)
data = meta.DateField("Data")
fornitore = meta.ForeignKey(Fornitore)
codice_ddt_fornitore = meta.CharField("Codice DDT Fornitore",
maxlength=30)

descrizione = meta.TextField("Descrizione",null=True,blank=True)
importo =
meta.FloatField("Importo",max_digits=10,decimal_places=2,null=True,default=0,help_text="Importo
del Conto (se presente)")
# fattura = meta.ForeignKey(Fattura,null=True,blank=True)

def costo_forniture(self):
....(cut)...
costo_forniture.short_description="Stima del Costo"

def __repr__(self):
return "%s - %s - %s - %s" %
(self.get_cantiere(),self.data,self.get_fornitore(),self.codice_ddt_fornitore)

class META:
db_table = "koan_ddt"
verbose_name = "Documento di Trasporto / Conto"
verbose_name_plural = "Documenti di Trasporto / Conti"
module_name = "ddt"

admin = meta.Admin(
fields = (("Campi
Obbligatori",{"fields":("cantiere","data","fornitore","codice_ddt_fornitore","importo")}),
("Campi
Opzionali",{"fields":("descrizione",),"classes":"collapse"}),
),

list_display=("cantiere","data","fornitore","codice_ddt_fornitore","costo_forniture"),
list_filter=("cantiere","fornitore"),
search_fields=("codice_ddt_fornitore",),
)
unique_together = (("fornitore","codice_ddt_fornitore"),)
pass
pass
"""

Have you any clue?

Thanks in advance,

Emanuele

Offline

#2 Dec. 5, 2005 10:59:01

Kenneth G.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

unexpected keyword argument 'member_name' (rev 1547)


On Monday 05 Dec 2005 4:15 pm, Emanuele wrote:
> today I upgraded to SVN version 1547, but when running admin
> interface I got this while adding an instance of a model ('ddt'
>  model):

try deleting all the .pyc files in the django tree (or delete the
whole tree and do a fresh svn checkout. Svn update does not
delete/change pyc files and this should be your problem

--
regards
kghttp://www.livejournal.com/users/lawgontally ho!http://avsap.org.inಇಂಡ್ಲಿನಕ್ಸ வாழ்க!

Offline

#3 Dec. 5, 2005 14:52:18

E.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

unexpected keyword argument 'member_name' (rev 1547)


I tried it but without success: I still get
---
TypeError at /admin/koan/ddt/add/
__init__() got an unexpected keyword argument 'member_name'
Request Method: GET
Request URL:http://127.0.0.1:8000/admin/koan/ddt/add/Exception Type: TypeError
Exception Value: __init__() got an unexpected keyword argument
'member_name'
Exception Location:
/usr/local/lib/python2.4/site-packages/django/core/meta/fields.py in
get_manipulator_fields, line 293
---
in both cases (removing .pyc or getting a fresh new svn checkout). I
start thinking it can be a django bug :((
I also tried to recreate all db information from scratch (init, install
app, install admin, createsuperuser etc.): no changes, same error.

Here you can find the complete traceback (~500 lines):http://sra.itc.it/people/olivetti/tmp/traceback.txtI'll try to dig into as soon as possible.

In any case, thanks for your help!

Emanuele

Offline

#4 Dec. 5, 2005 18:22:43

oggie r.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

unexpected keyword argument 'member_name' (rev 1547)


Hi Emanuele,
A quick glance at the use of 'member_name' in the output showed a line
that contained this:
'member_name': 'fornitura.0.materiale_id'

Is that supposed to be in your model?

-rob

Offline

#5 Dec. 6, 2005 15:43:53

E.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

unexpected keyword argument 'member_name' (rev 1547)


I think so. I've this:
----
class Fornitura(meta.Model):
ddt = meta.ForeignKey(DDT, edit_inline=meta.TABULAR,
num_in_admin=10, num_extra_on_change=10)
materiale = meta.ForeignKey(Materiale, core=True,
limit_choices_to={'disponibilita__exact':True}, raw_id_admin=True)
quantita =
meta.FloatField("Quantita",max_digits=10,decimal_places=2,core=True)
economia = meta.BooleanField("Economia",blank=False)
descrizione = meta.CharField("Descrizione",
maxlength=100,null=True,blank=True)
---
As you can see Fornitura has a foreignkey+editinline to DDT and another
foreignkey to Materiale.
I don't know if this is enough to justify 'member_name':
'fornitura.0.materiale_id'.

What do you think?

Thanks for you help,

Emanuele

Offline

#6 Dec. 6, 2005 18:48:58

oggie r.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

unexpected keyword argument 'member_name' (rev 1547)


Something that I noticed in the last update I did was that the
raw_id_admin field changed (again!). Originally it looked like this:
verbose_field_name <mag icon> selected_object.__repr__()
I think this changed sometime in the last few revs so that the
selected_object.__repr__() disappeared. With my last update (to 1556)
it came back again. Perhaps this has something to do with the problems
you are seeing.
Also might make sense to eliminate possibilities one by one, starting
with the extra options (limit_choices_to and raw_id_admin).

-rob

Offline

#7 Dec. 6, 2005 21:24:56

Gustavo P.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

unexpected keyword argument 'member_name' (rev 1547)


I submitted a patch inhttp://code.djangoproject.com/ticket/1006Hope it helps.

--
Gustavo Piconhttp://tabo.aurealsys.com

Offline

#8 Dec. 6, 2005 22:00:18

E.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

unexpected keyword argument 'member_name' (rev 1547)


In fact I've just updated to revision 1560 and the problem is still
there.

Then I added your submitted patch on "member_name" in formfields.py and
now everything WORKS PERFECTLY!!

Thanks a lot Gustavo!!
And thanks to rob for having spent time on my problem.

Emanuele

Offline

  • Root
  • » Django
  • » unexpected keyword argument 'member_name' (rev 1547) [RSS Feed]

Board footer

Moderator control

Enjoy the 27th of April
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support