cursor = connection.cursor() cursor.execute(''' br.branchpoint_str, br.source FROM branches as br LEFT JOIN branches_projects as bp ON br.id = bp.branch_id WHERE bp.project_id = "%s" AND source != "other" ORDER BY updated_at DESC ''', [int(project_id)]
) {% for br in special_branches %}
<tr class="{% if forloop.counter|divisibleby:2 %}even{% else %}odd{% endif %} highlightable" link="/files/{{build.image_path}}/build{{build.build_number}}/"> <td class="selectable">{{br.name}}</td> <td class="selectable">{{br.branchpoint}}</td> <td class="selectable center">{{ br.source|upper }}</td> <td class="selectable center">{{br.updated_at}} <td class="selectable center">{{br.built_at}}</td> </tr> {% endfor %}Hi,
Even you do have legacy database, you can use unmanaged models and then leverage full power of ORM [1].
Just create models and in their Meta set managed = False and
there you go.
And what comes to paging - you need to somehow pass offset and
limit to your query.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/f6a3df97-8218-4fb8-b200-f4535797e135%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
-- Jani Tiainen
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/7e4a44fc-e5ce-4562-8b75-09ba065e34f5%40googlegroups.com.