slinkymanbyday / greatlemers-django-tools

Automatically exported from code.google.com/p/greatlemers-django-tools
0 stars 0 forks source link

Failed to create new menu item through admin page #11

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Open url: admin/gdt_nav/menuoption/add/2/
2.Filling up all fields.
3.Submitting.

I expect to see new menu item.

But I see instead:

TemplateSyntaxError at /admin/gdt_nav/menuoption/add/2/
Caught an exception while rendering: u'2'

9             {% if field.is_checkbox %}
10                {{ field.field }}{{ field.label_tag }}
11            {% else %}
12                {{ field.label_tag }}{{ field.field }}
13            {% endif %}

The "{{ field.field }}" is red marked.

What version of the product are you using? On what operating system?
u'1.0-final-SVN-unknown' on Mac OS 10.4.11

Original issue reported on code.google.com by and...@polyakov.name on 3 Aug 2009 at 5:39

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r16.

Original comment by greatlemer@gmail.com on 3 Aug 2009 at 10:55

GoogleCodeExporter commented 8 years ago
Hi, thanks for the bug report.  It appeared to have been an issue that only 
came up if you failed to complete the 
form correctly.  I've committed a fix now so it shouldn't happen again.

--
G

Original comment by greatlemer@gmail.com on 3 Aug 2009 at 10:58

GoogleCodeExporter commented 8 years ago
I checked out revision 17. Yestarday I updated my django to 1.1 and it does not 
solve the problem so far. Django still highlight the {{ field.field }} as an 
exception source.
There are still an error in django/contrib/admin/templates/admin/includes/
fieldset.html, error at line 12.
This bug appears in: admin/gdt_nav/menuoption/add/*

Original comment by and...@polyakov.name on 4 Aug 2009 at 8:46

GoogleCodeExporter commented 8 years ago
Hi, sorry to hear that you're still having problems. Would you be able to 
provide a little more information 
so I can track this down. What type of menu item were you trying to add and do 
you have a same set of 
data that if entered would cause the problem to repeat. Finally which save 
button did you use?
I did manage to et somewhere that gave the error you mentioned last night but 
my fix stopped it for me 
so your issue must have been in a slightly different place. 

Cheers
--
G 

Original comment by greatlemer@gmail.com on 4 Aug 2009 at 3:19

GoogleCodeExporter commented 8 years ago
Does not matter what type of menu I choice and what button I click to save. 
Maby it 
is in Django. In the attached file error message.

Original comment by and...@polyakov.name on 4 Aug 2009 at 4:27

Attachments:

GoogleCodeExporter commented 8 years ago
I could't find data set wich does not fails, so probably the problem is not in 
data. 
Unfortunatly I cant even try this great module on my mac, by I'l try it on 
windows.

Original comment by and...@polyakov.name on 4 Aug 2009 at 4:32

GoogleCodeExporter commented 8 years ago
Thank you, I'll have another look at it. Meanwhile could you double check the 
version of the file that is in 
use. According to the traceback the problem seems to be on line 11 of forms.py 
however that one was 
updated and should be different as of version 16 (sorry to have to ask but I 
just want to rule out the 
obvious).

--
G

Original comment by greatlemer@gmail.com on 4 Aug 2009 at 5:35

GoogleCodeExporter commented 8 years ago
Hi,

I've had another look into this, but I can't seem to trigger the error any 
more.  As I mentioned previously, the 
code that's featured in the debug page you uploaded appears to be either 
modified or from an earlier revision 
of the library as the lines referenced don't match up.

I've tried to recreate this using both 1.0.X and 1.1 and OS X but unfortunately 
no combination produced the 
error leaving me stumped as to what the problem may be.

I have however added KeyError to the exceptions that should be caught at that 
point (something I should 
have included to begin with but should not have been called in your case) so if 
you once more update your 
code to r18 hopefully this time it will work.

After updating could you verify that at the top of the forms.py file the first 
class that's defined looks like this:
{{{
class MenuOptionWidget(forms.HiddenInput):
    def render(self, name, value, attrs=None):
        try:
          int_val = int(value)
          hidden_input = super(MenuOptionWidget,self).render(name,int_val,attrs)
          option_type_name = dict(MenuOption.MODEL_TYPE_CHOICES)[int_val]
        except (KeyError, ValueError), e:
          hidden_input = ''
          option_type_name = 'Unknown Selection'
        return mark_safe("%s%s" % (hidden_input, option_type_name))
}}}

Cheers,

--
G

Original comment by greatlemer@gmail.com on 5 Aug 2009 at 6:15

GoogleCodeExporter commented 8 years ago
Sorry, I cheked out the code not in python directory. That was my fault, evry 
thing 
works, thank you.

Original comment by and...@polyakov.name on 5 Aug 2009 at 7:45

GoogleCodeExporter commented 8 years ago
Ah, no worries that happens to everyone at one time or 
another. It did still highlight another problem that I'd missed 
so it was good that I went back to have another look at that 
bit of code.
I hope everything else works ok for you.

Cheers

--
G

Original comment by greatlemer@gmail.com on 5 Aug 2009 at 12:51