Hi,

> 1. I have a stored procedure in my mssql database server and i would
> like to call the procedure in my program with certain parameters.(Is
> there a way the results of the stored procedure be represented as a
> queryset?)
> 

Read about raw SQL:

  
http://docs.djangoproject.com/en/dev/topics/db/sql/#executing-custom-sql-directly

For MSSQL, you'll probably be passing sql like EXEC s_foo @p=1 and so on. I've 
not actually used MSSQL SPs with Django, but you might want to make sure your 
SP has SET NOCOUNT ON, as I've seen that cause problems in the past with other 
system.

> 2. The results returned from the procedure must be represented as a
> datagrid with a couple of columns as links and some non database
> column say a checkbox. The datagrid must have alternating colors and
> a  totals row at the end.
> 

Write a view that iterates through your result set and calculates the total. 
Pass that to a template along with the queryset returned from your original SQL 
call.

  http://docs.djangoproject.com/en/dev/topics/http/views/

As for the checkboxes, well, it's all just HTML. Use <input type='checkbox' /> 
and a form.

  http://www.w3schools.com/html/html_forms.asp


> 3. Also the stored procedure returns some column's which are numbers
> and have to be be represented as a distinct link which redirects to a
> distinct pages.
> 

Read about URL generation in Django:

  http://docs.djangoproject.com/en/dev/ref/templates/builtins/#url

> 4. whats the simplest way to implement the above requirements??
> 
> i went through forms and modelforms they are very helpful as you can
> print the entire form as a table. isn't there something similar in
> django to display a datagrid as i described earlier??

For very simple data browsing:  

  http://docs.djangoproject.com/en/dev/ref/contrib/databrowse/

It won't cover everything you want above, though - you're probably better off 
writing your own view and template. If it's something you're going to reuse 
often, consider writing a custom template tag to do it.

Cheers,
Dan

--
Dan Fairs | dan.fa...@gmail.com | www.fezconsulting.com


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