django.contrib.auth.views.login

2010-08-30 Thread ashy
Hi All,

I am using django.contrib.auth.views.login for the login view. The
code for 'registration/login.html' is as below:


  
User Login
  
  
User Login
{% if form.has_errors %}
  Your username and password didn't match.
 Please try again.
{% endif %}

  Username:
 {{ form.username }}
  Password:
 {{ form.password }}
  
  

  


The login process works correctly, but if there are errors the message
is not displayed. Any help in this regard.

thanks
ashy

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



django-twitter-oauth connection refused

2010-09-03 Thread ashy
Hi All,

I am using django-twitter-oauth app in my project, but I am getting
the following error while trying to connect to twitter.com.

Exception Value:(111, 'Connection refused')
Exception Location: /usr/lib/python2.6/socket.py in
create_connection, line 514

token = get_unauthorised_request_token(CONSUMER, CONNECTION)
resp = fetch_response(oauth_request, connection)
connection.request(oauth_request.http_method, url)

Also, Iam working behind proxy. How can I use oauth library behind
proxy? Any ideas.

thanks
ashy

-- 
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: django-twitter-oauth connection refused

2010-09-05 Thread ashy
Hi All,

Now I am getting 'Cannot send request' exception.
Exception Location:  /usr/lib/python2.6/httplib.py in putrequest, line
802
Some problem with httplib. Any ideas?

thanks
ashwin

On Sep 4, 1:16 am, Bill Freeman  wrote:
> No.  I'm not actually using twitter anywhere.  I just remember the
> email saying that the API changed on Tuesday, so I'm not surprised if
> things that worked before are broken now.
>
> On Fri, Sep 3, 2010 at 10:26 AM, ashwin morey  wrote:
> > Hi Bill,
>
> > Did you try using django-twitter-oauth
> >http://github.com/henriklied/django-twitter-oauth#readme?
> > I got the error while using this app.
>
> > thanks
> >     ashy
>
> > On Fri, Sep 3, 2010 at 7:46 PM, Bill Freeman  wrote:
>
> >> There was an email from twitter to it's users, yesterday or the day
> >> before,
> >> saying that they've changed their auth API.  I think it was a change to
> >> requiring OAUTH, but you may want to check whether port or SSL changes
> >> have occurred.
>
> >> On Fri, Sep 3, 2010 at 10:08 AM, ashy  wrote:
> >> > Hi All,
>
> >> > I am using django-twitter-oauth app in my project, but I am getting
> >> > the following error while trying to connect to twitter.com.
>
> >> > Exception Value:        (111, 'Connectionrefused')
> >> > Exception Location:     /usr/lib/python2.6/socket.py in
> >> > create_connection, line 514
>
> >> > token = get_unauthorised_request_token(CONSUMER,CONNECTION)
> >> > resp = fetch_response(oauth_request,connection)
> >> >connection.request(oauth_request.http_method, url)
>
> >> > Also, Iam working behind proxy. How can I use oauth library behind
> >> > proxy? Any ideas.
>
> >> > thanks
> >> >    ashy
>
> >> > --
> >> > 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.
>
> >> --
> >> 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.
>
> > --
> > 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.

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



simplegeo / python-oauth2

2010-09-06 Thread ashy
Hi All,

Iam using  simplegeo / python-oauth2  to connect to twitter.com
using python 2.6 and httplib2

getting the following error

Exception Type: error
Exception Value:(111, 'Connection refused')

the line which is causing the problem is this:
resp, content = client.request(request_token_url, "GET")

Any ideas?





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



django join queries

2010-09-13 Thread ashy
Hi All,

I have the following model class

from django.db import models
from django.contrib.auth.models import User

# Create your models here.
class Userdata(models.Model):
  user = models.ForeignKey(User)
  location = models.CharField(max_length=200)

I want to join them on user foreign key. How can I join User and
Userdata objects?

thanks
ashy

-- 
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: django join queries

2010-09-13 Thread ashy
Ok,

but I want to retrieve rows from both the tables based on the foreign
key.
User.objects.all()
or
Userdata.objects.all()
will give me data from either table. How can retrieve data from both
the tables using the foreign key?

thanks
   ashy

-- 
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: django join queries

2010-09-13 Thread ashy
Yes, I know that.
What is the object oriented way of getting the data from both the
tables based on the foreign key?

thanks for any help.

-- 
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: django join queries

2010-09-13 Thread ashy
Hi Nick,

I am trying to serialize the object and send it to the calling ajax
request

users = Userdata.objects.all()
HttpResponse(serializers.serialize('json', users),
mimetype='application/json')

in the javascript code, I do not get the user object to call
u.username.

I guess it wont work that way. Is there any alternate method.

thanks
   ashy

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



serialize dictionary problem

2010-09-20 Thread ashy
Hi All,

I am having problem retrieving object in javascript.

django function:

def function
  cursor = db.cursor(cursorclass=MySQLdb.cursors.DictCursor)
  sql = "select * from .."
  dict = cursor.fetchall()
  return HttpResponse(simplejson.dumps(dict), mimetype='application/
json')

javacript code:
function getuserinfo()
{
$.getJSON("/path", function(data) {
alert(data['location']);
});
}

the object is getting serialized properly, but in javascript
alert(data['location']);
always returns "undefined". Any ideas?

thanks
ashy

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



django forms

2010-09-21 Thread ashy
Hi All,

I want to create dynamic fields on the form, for instance I want the
city and state fields
to appear only when these properties are blank for the user. Can I
create such a form in
django? Any ideas?

thanks
ashy

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



convert list into a comma separated string

2010-10-04 Thread ashy
Hi All,

I am writing a django function in which I have a following list:
li = ['a','b','c']
I want to create a string from the list which should look like
str = 'a,b,c'

I plan to pass this string to not in () function of my sql query.

Any Ideas?

thanks
ashy



-- 
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: convert list into a comma separated string

2010-10-04 Thread ashy
Hi All,

my code is as below:
li = ['2l','1l']
str = ",".join(li)

but print str does not work for me :(

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



django graphs

2010-10-06 Thread ashy
Hi All,

I want to create line graph in django. I have installed django graphs,
but there aren't sufficient examples for line graphs in the examples
folder.  Any ideas how should I go ahead for graphs in django?

thanks
ashwin

-- 
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: django graphs

2010-10-06 Thread ashy
Thanks guys!!

I am basically looking for a dynamic line graph, where in the points
on the x axis and the points on the graph are clickable. Also, I want
it to be integrated with the django app I am working.

thanks
ashy

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