Hi,
If I upgrade to revision 4693 (or higher) I get below error. Revision
4692 works fine.
Any hints? I did start to play with unique_together earlier today
when I noticed it,
but don't think that's the reason. It's currently (and has been for
several months)
commented out.
Another small issue, if I try to make an IP address field and port
number 'unique_together'
Django creates an exception with a hint to insert a typecast. It's
not clear to me where to
do that. My workaround is simply to use CharField for the IP address.
Thanks,
Rob
------------------------------------------------------------------------
----------------------------------------------------
The models are:
class Schedule(models.Model):
"""The Schedule class."""
name = models.CharField(maxlength=40, unique=True)
sch_excs = models.ManyToManyField(ScheduleHolidayException,
null=True, blank=True,
filter_interface=models.HORIZONTAL)
def __str__(self):
return self.name
def employees(self):
return '<a href="/schedule/%s/employees">Employees</a>' %
self.id
employees.allow_tags = True
class Admin:
fields = (
('Name', {'fields': ('name',), }),
('Holiday exceptions', {'fields':
('sch_excs',), 'classes' :
'collapse'}),
)
list_display = ('__str__', 'employees')
save_on_top = True
class Meta:
db_table = 'sch'
class ScheduleDayOfTheWeek(models.Model):
"""Access times at days of the weeks
"""
day_choices = (
('0', 'Sunday'),
('1', 'Monday'),
('2', 'Tuesday'),
('3', 'Wednesday'),
('4', 'Thursday'),
('5', 'Friday'),
('6', 'Saturday')
)
day = models.CharField(maxlength=1, choices=day_choices)
sch = models.ForeignKey(Schedule, edit_inline=models.TABULAR,
num_in_admin=7, min_num_in_admin=7, max_num_in_admin=7)
start_time = models.TimeField(core=True, default = datetime.time(0,
0, 0))
end_time = models.TimeField(core=True, default = datetime.time(0, 0,
0))
def __str__(self):
return self.day + ' of schedule ' + self.sch.name
class Meta:
# unique_together = (('day', 'sch'),)
ordering = ('day',)
db_table = 'sch_dow'
verbose_name_plural = 'Days of the week in schedules'
KeyError at /admin/Application_Settings/schedule/15/
"Could not find Formfield or InlineObjectCollection named
'Application_Settings_scheduledayoftheweek'"
Request Method:
GET
Request URL:
http://localhost:8000/admin/Application_Settings/schedule/15/
Exception Type:
KeyError
Exception Value:
"Could not find Formfield or InlineObjectCollection named
'Application_Settings_scheduledayoftheweek'"
Exception Location:
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-
packages/django/oldforms/__init__.py in __getitem__, line 135
Template error
In template /Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/django/contrib/admin/templates/admin/
change_form.html, error at line 57
Caught an exception while rendering: "Could not find Formfield or
InlineObjectCollection named
'Application_Settings_scheduledayoftheweek'"
47
{% block after_field_sets %}{% endblock %}
48
{% if change %}
49
{% if ordered_objects %}
50
<fieldset class="module"><h2>{% trans "Ordering" %}</h2>
51
<div class="form-row{% if form.order_.errors %} error{% endif %} ">
52
{% if form.order_.errors %}{{ form.order_.html_error_list }}{%
endif %}
53
<p><label for="id_order_">{% trans "Order:" %}</label>
{{ form.order_ }}</p>
54
</div></fieldset>
55
{% endif %}
56
{% endif %}
57
{% for related_object in inline_related_objects %}{% edit_inline
related_object %}{% endfor %}
58
{% block after_related_objects %}{% endblock %}
59
{% submit_row %}
60
{% if add %}
61
<script type="text/javascript">document.getElementById
("{{ first_form_field_id }}").focus();</script>
62
{% endif %}
63
{% if auto_populated_fields %}
64
<script type="text/javascript">
65
{% auto_populated_field_script auto_populated_fields change %}
66
</script>
67
{% endif %}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---