On Sat, Mar 14, 2009 at 6:47 AM, timc3 wrote:
>
> > > So is that the list that you are talking about?
> >
> > I'm assuming those values corropond tot he fields on the model, any
> reason
> > you can't do:
> >
> > self.model(**cursor.fetchone())
>
>
> Just tried to do that but it
> > So is that the list that you are talking about?
>
> I'm assuming those values corropond tot he fields on the model, any reason
> you can't do:
>
> self.model(**cursor.fetchone())
Just tried to do that but it seems to be returning things as a tuple
so I get the error:
ModelBase object
On Tue, Mar 10, 2009 at 5:30 PM, timc3 wrote:
>
> Well I tried that:
>
>def get_perm(self, *args, **kwargs):
>from django.db import connection
>cursor = connection.cursor()
>cursor.execute("""
>SELECT * FROM permfindernew(2, 132);
>
Well I tried that:
def get_perm(self, *args, **kwargs):
from django.db import connection
cursor = connection.cursor()
cursor.execute("""
SELECT * FROM permfindernew(2, 132);
""")
result_list = []
for row in
Tim,
Here is how I do it with a different query. Using the fetchall() and
getting it into a list works nicely. I know that there should be a
better way to do this so that we're not making a list twice - but this
works:
query = """SELECT b.created_on, SUM(a.vote)
Hi,
I have built my models and so forth, but I have the need to check
whether the user requesting an instance or set of instances from the
database has permission to do so.
For this I have a stored procedure (saved procedure) in the database
that when I give it a user id, it then returns the
6 matches
Mail list logo