Re: Looking for a Learning Buddy

2023-10-13 Thread Pranav Sawant
Hi, I also want to join in this group. I have basic knowledge of Machine 
Learning and Django.

On Friday, October 13, 2023 at 7:09:07 PM UTC+5:30 Migui Galan wrote:

> Hi Hazida, I have a basic knowledge in machine learning and I'd like to 
> hear more about your project. 
>
>
> On Fri, Oct 13, 2023 at 3:01 PM Hafiza Nafeesa Asif  
> wrote:
>
>> I have bases in Django but not yet In machine learning. So if you help me 
>> to handle machine learning, we can work together 
>>
>> On Sat, 17 Jun 2023, 3:00 am John Ayodele,  wrote:
>>
>>> Hi! It's John.
>>>
>>> I am currently looking for a learning buddy, for Machine Learning.
>>> I have little experience in Django and I code in Python.
>>>
>>> The learning buddy would have one-on-one meetings with me so we can 
>>> share ideas and learn together.
>>> It is really going to be a fun experience.
>>> The reason I am looking for a learning buddy is because I find it more 
>>> fun learning with people rather than just being self-taught alone.
>>> I will be going to university later this year or next year.
>>> 
>>> If this sounds like you, please do not hesitate to contact me. 
>>> 
>>>
>>> Thanks.
>>> John Ayodele
>>>
>>> -- 
>>> 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 view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/CAP7pJ3gsn_bkOfP-8k-SNZ%2BmmJ8riuc1cdUVXzoQXN31BS4W4g%40mail.gmail.com
>>>  
>>> 
>>> .
>>>
>> -- 
>> 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 view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/CAO5ZLjUEzb1Uzp6K1569gOLdPGuAQoE3f8ndGMcviA_CpGFo7w%40mail.gmail.com
>>  
>> 
>> .
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a199a6cc-9843-41a3-8275-4ac3bb37bf89n%40googlegroups.com.


Re: Postgres connection error

2023-10-08 Thread Pranav Sawant
Thank you for assistance. 
I just checked and saw that owner of my database was postgres, and thats 
why it was not giving create permission to other users so i changed the 
owner and it worked 

On Monday, October 9, 2023 at 4:00:57 AM UTC+5:30 Mike Dewhirst wrote:

> There is a step missing somewhere if migrations has incorrect permissions.
>
> If Django is correctly installed - as it seems to be - then your settings 
> must be deficient somewhere. The first migration ought to create Django's 
> own tables etc even if you haven't written any of your own models.
>
> I would start again and follow the docs exactly. Perhaps follow the 
> tutorial.
>
> Also, you can happily keep things super-simple if you plan to throw 
> everything away and start fresh after learning the ropes.
>
> Good luck
>
> Mike
>
>
>
> --
> (Unsigned mail from my phone)
>
>
>
>  Original message 
> From: Pranav Sawant  
> Date: 9/10/23 01:24 (GMT+10:00) 
> To: Django users  
> Subject: Postgres connection error 
>
> *Hey all, I am new to django*
> *and i want to connect to postgresql *
>
> *what I have doing:*
>
> *At postgres plsql*
> CREATE DATABASE knapds; CREATE USER system WITH PASSWORD 'password'; ALTER 
> ROLE system SET client_encoding TO 'utf8'; ALTER ROLE system SET 
> default_transaction_isolation TO 'read committed'; ALTER ROLE system SET 
> timezone TO 'Africa/Johannesburg'; GRANT ALL PRIVILEGES ON DATABASE knapds 
> TO system; \q 
> *in settings.py:*
>
> 'ENGINE': 'django.db.backends.postgresql_psycopg2',
> 'NAME': 'knapds',
> 'USER': 'system',
> 'PASSWORD': 'password',
> 'HOST': 'localhost',
> 'PORT': '',
>
> *and I am getting this error:*
>
> django.db.migrations.exceptions.MigrationSchemaMissing: Unable to create 
> the django_migrations table (permission denied for schema public
> LINE 1: CREATE TABLE "django_migrations" ("id" bigint NOT NULL PRIMA...
>
> Please help
>
> -- 
> 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 view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/a9eeca40-befa-4a0b-b1fc-db78924e6218n%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/django-users/a9eeca40-befa-4a0b-b1fc-db78924e6218n%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d1183f24-b0a6-4345-8ca5-831e29c02a36n%40googlegroups.com.


Postgres connection error

2023-10-08 Thread Pranav Sawant
*Hey all, I am new to django*
*and i want to connect to postgresql *

*what I have doing:*

*At postgres plsql*
CREATE DATABASE knapds; CREATE USER system WITH PASSWORD 'password'; ALTER 
ROLE system SET client_encoding TO 'utf8'; ALTER ROLE system SET 
default_transaction_isolation TO 'read committed'; ALTER ROLE system SET 
timezone TO 'Africa/Johannesburg'; GRANT ALL PRIVILEGES ON DATABASE knapds 
TO system; \q 
*in settings.py:*

'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'knapds',
'USER': 'system',
'PASSWORD': 'password',
'HOST': 'localhost',
'PORT': '',

*and I am getting this error:*

django.db.migrations.exceptions.MigrationSchemaMissing: Unable to create 
the django_migrations table (permission denied for schema public
LINE 1: CREATE TABLE "django_migrations" ("id" bigint NOT NULL PRIMA...

Please help

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a9eeca40-befa-4a0b-b1fc-db78924e6218n%40googlegroups.com.


Re: Invalidate cached copy when changes are made.

2011-01-28 Thread Pranav
Thanks for the reply Matias. I'll give signals a try but pagination is
definitely a no go. I want to see all the members at a stretch.
Isn't there a simple way to tell the django cache to get a new copy,
if changes are made?

I'm sure the admin or something must have something like what i
want

On Jan 28, 9:25 am, Matias Aguirre  wrote:
> You could use signals[1] to update cache on save event, but I think you
> are approaching the issue in the wrong way, why not paginate[2] the
> result?
>
> Regards,
> Matías
>
> [1]:http://docs.djangoproject.com/en/dev/topics/signals/
> [2]:http://docs.djangoproject.com/en/dev/topics/pagination/
>
> Excerpts from Pranav's message of Fri Jan 28 01:36:02 -0200 2011:
>
> > Hi all,
>
> > I have a model that ruffly looks like so,
>
> > Class Member(model);
> >           member_id = model.Integerfield(primary_key=True)
> >           organization = model.foreignerkey(primary_key=True)
> >           transorg = model.foreignerkey()
> >           bo_name = model.foreignerkey()
> >          member_create_date = model.datetimefield()
> >          member_modified_date = model.datetimefield()
> >          ...
> >          class meta:
> >             db_table = 'Member'
> >             unique_together = ('member_id','organization')
>
> >        I have a view (display members) which allows user to search
> > based on multiple foreigner keys, the result ruffly returns about 811
> > Members and takes a long time to execute. So i started using cache
> > which resulted in faster serving of the page but when changes are made
> > to one of the Member the change is not shown on the display member
> > page, instead it still shows the cached page, i used decorator @cache-
> > control(must_revalidate=True) but i figured it has a max age. I
> > thought I'll use @condition(Etag_func,last_modified_func,) but i'm not
> > clear how to use it, since I'm filtering based on multiple fields,
> > also my result returns 811 members, so I'll have to check
> > member_modified_date of 811 members??? Is there a way i can use the
> > cache so that it gets a new copy when i make changes.
>
> --
> Matías Aguirre 

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



Invalidate cached copy when changes are made.

2011-01-27 Thread Pranav
Hi all,

I have a model that ruffly looks like so,

Class Member(model);
  member_id = model.Integerfield(primary_key=True)
  organization = model.foreignerkey(primary_key=True)
  transorg = model.foreignerkey()
  bo_name = model.foreignerkey()
 member_create_date = model.datetimefield()
 member_modified_date = model.datetimefield()
 ...
 class meta:
db_table = 'Member'
unique_together = ('member_id','organization')


   I have a view (display members) which allows user to search
based on multiple foreigner keys, the result ruffly returns about 811
Members and takes a long time to execute. So i started using cache
which resulted in faster serving of the page but when changes are made
to one of the Member the change is not shown on the display member
page, instead it still shows the cached page, i used decorator @cache-
control(must_revalidate=True) but i figured it has a max age. I
thought I'll use @condition(Etag_func,last_modified_func,) but i'm not
clear how to use it, since I'm filtering based on multiple fields,
also my result returns 811 members, so I'll have to check
member_modified_date of 811 members??? Is there a way i can use the
cache so that it gets a new copy when i make changes.

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



Calling a mssql stored procedure and displaying the result as a datagrid

2010-12-10 Thread Pranav
Hi all,

I'm new to django and sorry if my questions are too basic.

I have a some requirements

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?)

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.

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.

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

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



Re: get_object_or_404 on composite key and Value Error:Invalid Literal for int with base 10

2010-12-01 Thread Pranav


On Dec 2, 12:10 am, bruno desthuilliers
<bruno.desthuilli...@gmail.com> wrote:
> On 1 déc, 19:20, Pranav <pranav...@gmail.com> wrote:
>
> > Hi all,
>
> > I'm new to django and python and i'm working on a project that works
> > with a legacy database.
> > I've a particular problem with a "composite key" and "get" or
> > "get_object_or_404".
>
> > i generated the below model form the legacy database using inspectdb
>
> > model:
> > --
> > class Member:
>
> This should inherit from models.Model
>
> >            member_id = field.CharField(max_length=20)
> >            organization_id = field.Foreignkey(Organization)
> >            member_type = field.CharField(max_length=10)
> >            class Meta:
> >                     db_table = u'member'
> >                     unique_together =
> > (('member_id','organization_id'),)
> > # unique_together is a constraint i added in order to form the
> > composite primary key
>
> It's a composite key, but it's not a primary key - or at least it's
> not recognized as such by Django (hint: Django doesn't handle
> composite primary keys so far)
>
> > class Organization:
>
> idem
>
>
>
> > I have a function in my view which receives a "MemOrgId" which is
> > nothing but the composite key of both member_id and organization_id.
> > for example the value i get is MemOrgId='AA1001', now the problem is
> > when i try to use get or a get_object_or_404 i get a Value
> > Error:Invalid Literal for int with base 10.
>
> > obj = get_object_or_404(Member,pk = MemOrgId)
>
> Since you didn't explicitly declared a primary key for your Member
> model, Django automagically adds one, named "id" and defined as an
> autoincrement integer, so the 'pk' shortcut resolves to this int
> field.
>
> > According to my understanding of the trace back its not able to
> > convert the key "CP1001" to int coz it contains char data along with
> > int. I cannot modify the database
>
> Should not be a major problem.
>
> > and i cannot change the way MemOrgId
> > comes to the view function.
>
> Why ?
>
> > Is there a way around this problem
>
> Yes: split the compound key and do an explicit lookup:
>
> def yourview(request, MemOrgId):
>     oid, mid = MemOrgId[0:2], MemOrgId[2:]
>     obj = get_object_or_404(
>        organization_id=oid,
>        member_id=mid
>        )
>
> IRL you probably want a bit more validation on what the MemOrgId arg
> looks like - but this can be done with the correct regexp in your
> urls.py

Thanks your solution worked, but now i have a bigger problem i cant
seem to save my form.
Django adds a automatic "id" to the table which i don't have in my
database so my database is throwing an error. Also none of the fields
in my table are unique so cannot set manual primary_key=True, I cannot
change the database as I said earlier. Is there a way to ignore this
auto generated id or a way to use the create a table without any
primary keys.

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



get_object_or_404 on composite key and Value Error:Invalid Literal for int with base 10

2010-12-01 Thread Pranav
Hi all,

I'm new to django and python and i'm working on a project that works
with a legacy database.
I've a particular problem with a "composite key" and "get" or
"get_object_or_404".

i generated the below model form the legacy database using inspectdb

model:
--
class Member:
   member_id = field.CharField(max_length=20)
   organization_id = field.Foreignkey(Organization)
   member_type = field.CharField(max_length=10)
   class Meta:
db_table = u'member'
unique_together =
(('member_id','organization_id'),)
# unique_together is a constraint i added in order to form the
composite primary key

class Organization:
   organization_id = field.CharField(max_length=2)
   organization_name = field.CharField(max_length=20)
   class Meta:
db_table = u'organization'

I have a function in my view which receives a "MemOrgId" which is
nothing but the composite key of both member_id and organization_id.
for example the value i get is MemOrgId='AA1001', now the problem is
when i try to use get or a get_object_or_404 i get a Value
Error:Invalid Literal for int with base 10.

obj = get_object_or_404(Member,pk = MemOrgId)

i assign the object instance to my form and save the form if the form
is valid.

The Trace Back starts with my view and ends at "fields.__init__."
which retuns int(value).

According to my understanding of the trace back its not able to
convert the key "CP1001" to int coz it contains char data along with
int. I cannot modify the database and i cannot change the way MemOrgId
comes to the view function. Is there a way around this problem

Thanks for your help.

Regards,
Pranav Hegde.




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



Re: Custom Login using model form

2010-11-26 Thread PRANAV HEGDE


On Nov 26, 1:57 am, Daniel Roseman <dan...@roseman.org.uk> wrote:
> On Nov 25, 7:53 am, PRANAV HEGDE <pranavhegde...@gmail.com> wrote:
>
>
>
>
>
>
>
>
>
> > Hi guys,
>
> > I'm trying to create a login form using a model form,
>
> > user model:
> > class users(models.Model):
> >     username = models.CharField(max_length=20, primary_key=True)
> >     password = models.CharField(max_length=50)
> >     usertype = models.CharField(max_length=20)
> >     class Meta:
> >         db_table = u'users'
>
> > login form:
> > class loginlorm(forms.ModelForm):
> >     class Meta:
> >         model = users
> >         fields = ('username','password','usertype')
> >         widgets = {
> >                     'username':TextInput(),
> >                     'password':PasswordInput(),
> >                     'usertype':Select(choices=(("t1","type1"),
> > ("t2","type2"))),
> >                    }
>
> > The form comes up as i wanted it to, but when i login it gives a
> > validation error saying "user with this name already exists".
> > I think its "form.is_valid()" checking "primary key" constraint,
> > thinking i'm trying to write into the table. :(
> > I cant remove the "primary key" constraint on "username" is there a
> > way around this problem..
>
> Why do you want a modelform though? The usual reason is to allow you
> to add users or edit existing ones - since you don't supply an
> existing user when instantiating the form, Django assumes you want to
> create a new one, hence the error. But what are you gaining by using
> the modelform here? It seems to me, nothing at all. Instead of
> subclassing modelform, setting the model, and defining the widgets,
> you might as well just use a normal form and define the fields
> directly.
> --
> DR.


Hi Daniel,

Yeah I had a thought like that. I thought I could leave the validation
to the model.
Turns out model form comes handy only if your modifying or updating
something in the database, as you said.
Simple form can also enforce constraints but I just have to write
another form with same constraints as the model.

Thanks for the suggestion.

Warm Regards,
Pranav.

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



Custom Login using model form

2010-11-25 Thread PRANAV HEGDE
Hi guys,

I'm trying to create a login form using a model form,

user model:
class users(models.Model):
username = models.CharField(max_length=20, primary_key=True)
password = models.CharField(max_length=50)
usertype = models.CharField(max_length=20)
class Meta:
db_table = u'users'

login form:
class loginlorm(forms.ModelForm):
class Meta:
model = users
fields = ('username','password','usertype')
widgets = {
'username':TextInput(),
'password':PasswordInput(),
'usertype':Select(choices=(("t1","type1"),
("t2","type2"))),
   }

The form comes up as i wanted it to, but when i login it gives a
validation error saying "user with this name already exists".
I think its "form.is_valid()" checking "primary key" constraint,
thinking i'm trying to write into the table. :(
I cant remove the "primary key" constraint on "username" is there a
way around this problem..

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



Re: Displaying a template table using a query set

2010-10-20 Thread Pranav


On Oct 20, 5:24 pm, Steve Holden <holden...@gmail.com> wrote:
> On 10/20/2010 7:58 AM, Pranav wrote:
>
>
>
>
>
> > On Oct 20, 4:13 pm, Daniel Roseman <dan...@roseman.org.uk> wrote:
> >> On Oct 20, 8:29 am, Pranav <pranav...@gmail.com> wrote:
>
> >>> I'm trying to display a table in template using the result retrieved
> >>> from a query set, but i get problem when i try to display the table
> >>> iterating through each row'' and column''
>
> >>> view file:
> >>> from django.shortcuts import get_object_or_404, render_to_response
> >>> from models import Organization
>
> >>> def startpage(request):
> >>>     table_data = Organization.objects.all()
> >>>     return render_to_response('display_table.html', {'table_data':
> >>> table_data})
>
> >>> display_table template file:
> >>>   
> >>>         {% for row in table_data %}
> >>>             
> >>>             {% for value in row %}
> >>>                 
> >>>                     {{ row }}
> >>>                 
> >>>             {% endfor %}
> >>>             
> >>>         {% endfor %}
> >>>     
>
> >>> when i try to run this i get an error saying the object is not
> >>> itreable for the second for loop. please provide a solution to this
> >>> issue...
>
> >>> Thanks and Regards
> >>> Pranav
>
> >> `value` is an Organisation instance, and model instances are not
> >> iterable, as you could see by trying it in the shell.
>
> >> You could try passing a values_list instead of a queryset:
> >>     table_data = Organization.objects.all().values_list()
> >> as these are iterable.
> >> --
> >> DR.
>
> > Hi Dan,
> >     Thanks for the fix it worked.
> > I guess Organization.objects.all().values_list() returns a list.
> > But what if i want to refer to a particular field say Organization.id
> > inside my template?
>
> > like:
> > 
> > {% for row in table_data %}
> >   
> >   
> >      {{ row.Organization.id }} 
> >   
> >   
> > <% endfor %}
> > 
>
> > I guess I'll have to pass another query set object to do this,
> > will this have any effect on the throughput of the database?
> > Is it possible to access cached result of the query set inside the
> > template?
>
> The point is that normally you don't just want to iterate over the
> columns of a retrieved row, since they have differences in meaning that
> normally require differences in display formatting and the like as well.
>
> Therefore the solution you offer above is more or less what you actually
> do.
>
> regards
>  Steve
> --
> DjangoCon US 2010 September 7-9http://djangocon.us/

Hi Steve,
I know its a bit odd to display only a column of a table, but
thats the only way i can display a href list and a full fledged table
next to each other.
I guess I'll just have to go with passing 2 query set objects

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



Re: Displaying a template table using a query set

2010-10-20 Thread Pranav


On Oct 20, 4:13 pm, Daniel Roseman <dan...@roseman.org.uk> wrote:
> On Oct 20, 8:29 am, Pranav <pranav...@gmail.com> wrote:
>
>
>
>
>
> > I'm trying to display a table in template using the result retrieved
> > from a query set, but i get problem when i try to display the table
> > iterating through each row'' and column''
>
> > view file:
> > from django.shortcuts import get_object_or_404, render_to_response
> > from models import Organization
>
> > def startpage(request):
> >     table_data = Organization.objects.all()
> >     return render_to_response('display_table.html', {'table_data':
> > table_data})
>
> > display_table template file:
> >   
> >         {% for row in table_data %}
> >             
> >             {% for value in row %}
> >                 
> >                     {{ row }}
> >                 
> >             {% endfor %}
> >             
> >         {% endfor %}
> >     
>
> > when i try to run this i get an error saying the object is not
> > itreable for the second for loop. please provide a solution to this
> > issue...
>
> > Thanks and Regards
> > Pranav
>
> `value` is an Organisation instance, and model instances are not
> iterable, as you could see by trying it in the shell.
>
> You could try passing a values_list instead of a queryset:
>     table_data = Organization.objects.all().values_list()
> as these are iterable.
> --
> DR.

Hi Dan,
Thanks for the fix it worked.
I guess Organization.objects.all().values_list() returns a list.
But what if i want to refer to a particular field say Organization.id
inside my template?

like:

{% for row in table_data %}
  
  
 {{ row.Organization.id }} 
  
  
<% endfor %}


I guess I'll have to pass another query set object to do this,
will this have any effect on the throughput of the database?
Is it possible to access cached result of the query set inside the
template?

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



Displaying a template table using a query set

2010-10-20 Thread Pranav
I'm trying to display a table in template using the result retrieved
from a query set, but i get problem when i try to display the table
iterating through each row'' and column''

view file:
from django.shortcuts import get_object_or_404, render_to_response
from models import Organization

def startpage(request):
table_data = Organization.objects.all()
return render_to_response('display_table.html', {'table_data':
table_data})

display_table template file:
  
{% for row in table_data %}

{% for value in row %}

{{ row }}

{% endfor %}

{% endfor %}


when i try to run this i get an error saying the object is not
itreable for the second for loop. please provide a solution to this
issue...

Thanks and Regards
Pranav

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