Hi,

How can I know about the limiting parameters inside a custom manager method?

Example:

class MyManager(models.Manager):
    def my_query(self):
        # How can I find out about offset and length ?
        cursor.execute("SELECT foo FROM bar LIMIT %d, %d", [offset, length])

class MyModel(models.Model)
    foo = models.CharField(maxlength=200)
    my_objects = MyManager()

# The following should result in offset=0 and length=5 above
first_rows = MyModel.my_objects.my_query()[:5]

Is this possible?

Regards,

--
  Olivier

--~--~---------~--~----~------------~-------~--~----~
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