Here is my problem. I have a database already filled with some sort of
data. I have several tables with "some code" - "value" (without any
primary keys at all, but codes are unique). Also there is a table
(called c12b) with a "some thing" "note_1", "note_2" "code_1"
"code_2", where code_1, code_2 are described in that " several
tables", "note_1", "note_2" - some fields with useful info. So, I need
a queryset, which contains "some thing" "note_2" (not all note fields)
"code_1 value" "code_2 value".

I have default models for all tables. Code tables have a
"primary_key=True" on each code field implementation.

in my models.py

class mod_prkp_g_r  (models.Manager):
    def get_query_set (self):
        return super (mod_prkp_g_r, self).get_query_set().values_list
('A1', 'A2', 'A20', 'A22','A19',  'A41', 'A36', 'A38').filter
(A34__exact ="02100")

class prkp_g_r (c12b): #с12b - таблица "предмет"
    ecor = models.ForeignKey (Oker,  to_field="RA") #Oker - one of the
tables with code-value (RA-code, N1 - value)
    pObjects = mod_prkp_g_r()

class Oker (models.Model):
    RA = models.CharField ('code', max_length=3, primary_key=True,
blank=True)
    N1 = models.CharField ('value', max_length=50, blank=True)

views.py

def prkp
....
    result = prkp_g_r.pObjects.all().select_related ()
    return render_to_response ("shablon.html",  {
                                                   "result":result,

in shablon.html
...
{% for i in result %}
    <tr>
    <td>{{ i.A1 }}</td>
    <td>{{ i.A2 }}</td>
    <td>{{ i.ecor }}</td>

....

and I get an error
TemplateSyntaxError at (my request url)
Caught an exception while rendering: relation "prkp_prkp_g_r" doesn't
exists
in a {% for i in result %} string
What have I done wrong?

--~--~---------~--~----~------------~-------~--~----~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to