Hi,

I am new to both Django and Python and yet I'm developing a site for
myself. I have some programming skills in REXX, Pascal and Bash and
that helps a little.

I need to do one of the simplest things, yet I hit a roadblock.

I lost literally a week searching every little page for solution to my
problem. It appears quite obvious on the first look but my brain is
clogged right now because I read a quick introduction to Python and
nearly whole djangobook.com trying to understand as much as i can.
This was too much. Anyway, back to the subject:

I need to display two Panels at *every* subpage - that's why I thought
about using template tags. Each Panel would hold Categories sorted by
"position" field (and "-date_mod" as fallback). Each Category could
hold elements such as Link (with "url" and "name" fields) and Page
(semi-static, with "content", "visible" and "date_pub"). Link and Page
both have "category" field which is a ForeignKey(Category), "position"
field which should determine their position in Category (again "-
date_mod" as fallback sort) and a "date_mod" field.

If you have better idea how to achieve this simple goal, please share
it. All I need is to write a subpage and assign it to a category, and
link to that subpage should appear in that category. And if I want to
put a link to external page in the same category it should appear
there just like that.

I've put up a static demo of what I have in mind: 
http://dominik.kozaczko.info/django/

I have stripped-down model here: http://pastebin.com/m3f5cf035
Plus here is template_tags definition and the test template:
http://pastebin.com/d167aa968

The problem is - when I eneter all queries in shell, they behave
perfectly. But this does not work in real world. I tried debugging
with print statements - context is returned perfectly to the template.
Yet the for loop can't iterate through 'list_groups' and an error
occurs at line 53 (second pastebin), where the "for" loop begins. It
returns error "Group matching query does not exist." and the traceback
is like this:

Traceback:
File "/usr/lib/python2.4/site-packages/django/template/debug.py" in
render_node
  71.             result = node.render(context)
File "/usr/lib/python2.4/site-packages/django/template/defaulttags.py"
in render
  149.                 nodelist.append(node.render(context))
File
"/home/dominik/stuff/projekty/django/test/../test/szablony/
templatetags/szabtags.py"
in render
  87.           objects = Group.objects.get(id=self.groupid)
File "/usr/lib/python2.4/site-packages/django/db/models/manager.py" in
get
  82.         return self.get_query_set().get(*args, **kwargs)
File "/usr/lib/python2.4/site-packages/django/db/models/query.py" in
get
  196.             raise self.model.DoesNotExist("%s matching query
does
not exist."

Exception Type: DoesNotExist at /test/
Exception Value: Group matching query does not exist.



I have no idea what is wrong  :(

Again, if you have better idea how to achieve this simple goal, please
please please share it.


I use Django-SVN and Python 2.4 on Linux


Best wishes,
Dominik Kozaczko
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to