Re: CSRF verification failed

2013-07-06 Thread Kakar Arunachal Service
Thank you Sanjay!


On Sun, Jul 7, 2013 at 4:08 AM, Sanjay Bhangar wrote:

> On Sat, Jul 6, 2013 at 9:38 AM, Kakar Arunachal Service <
> kakararunachalserv...@gmail.com> wrote:
>
>> Hello!
>> I am getting CSRF verification failed error, even after i added {%
>> csrf_token %} tag in the html file.
>>
>> Here's my html file:
>>
>> {% extends "base.html" %}
>> {% block title %} User Registration {% endblock %}
>> {% block head %} User Registration {% endblock %}
>> {% block content %}
>> 
>> {% csrf_token %}
>> {{ form.as_p }}
>> 
>> 
>> {% endblock %}
>>
>> and my views.py:
>>
>> def register_page(request):
>> if request.method == 'POST':
>> form = RegisrationForm(request.POST)
>> if form.is_valid():
>> user = User.objects.create_user(
>> username = form.cleaned_data['username'],
>> password = form.cleaned_data['password1'],
>> email = form.cleaned_data['email']
>> )
>> return HttpResponseRedirect('/')
>> else:
>> form = RegisrationForm()
>> variables = RequestContext(request, {
>> 'form': form
>> })
>> return render_to_response('registration/register.html',
>> variables)
>> else:
>> return render_to_response('registration/register.html')
>>
>> else:
>   return render_to_response("registration/register.html",
> RequestContext(request, {})
>
>
>> Where am i doing wrong???
>>
>
> In your outer else statement, you need to return a RequestContext instance
> ..
>
> You could also use the 'render' shortcut:
> from django.shortcuts import render
>
> .
>
> return render(request, "registration/register.html")
>
> Basically, you need to make sure the template has the context created by
> RequestContext, otherwise csrf_token will not be available as a variable on
> the template.
>
> Hope that helps,
> Sanjay
>
>
>
>>
>>  --
>> 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 post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>  --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Big Picture?

2013-07-06 Thread ron
I need help with getting the big picture in so far as what Django can help 
me accomplish. I need to replace an antiquated online attendance-taking 
system. My first thought was to just build from scratch using Apache, 
Python, MySQL, HTML/JavaScript. My first stop was researching how to 
integrate Python and Apache, but that led me down the rabbit hole of 
programming. I kept running across using "Frameworks". From my reading so 
far, I can't determine if Django, as a framework, will yeild any advantage 
over just implementing the standalone bits and pieces.

I'm putting out the word, here on the kist, for direction in this matter. 
My mail confusion is, does Django ome with its own database, and is this 
the same type database that I'm referring to to when I mentioned doing this 
task using the autonomous pieces?

Thanks.

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Soundex in django

2013-07-06 Thread Satinderjit Singh
On Sat, Jul 6, 2013 at 1:17 PM, Harjot Mann  wrote:
> How to import soundex in django??


May be this can help.
Try this link:
http://goo.gl/77F7s

--


Satinderjit
http://satinderjit.wordpress.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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Allowed Hosts

2013-07-06 Thread deJa
Hello, 
I'm developing an application with 1.6b1 and getting "ERROR: Invalid 
HTTP_HOST header: www.foo.com.'.You may need to add u'www.foo.com.' to 
ALLOWED_HOSTS. 

And I'm getting same error with my naked domain or server's IP address like 
'.You 
may need to add u'.foo.com.'  or '.You may need to add u'xxx.xxx.xxx.xxx'

The thing is all of these 3 hosts are already in allowed hosts in my 
settings file as 
ALLOWED_HOSTS = [u'.foo.com', u'www.foo.com', u'xxx.xxx.xxx.xxx'] 

In the mail body it only says "No stack trace available Request repr() 
unavailable."

So, is this a bug or do I have an error somewhere or do you need more data 
to get a conclusion?

Thanks in advance.

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Help needed with Django Slug Url Caveat

2013-07-06 Thread JJ Zolper
Hello fellow Django developers,

I would like to request your assistance on a caveat I ran into when doing 
slugs in the django url's.

First off please let me lay out what I've been building:

Here are the internals of my urls.py:

(r'^artists/register/$', 'madtrak.userprofiles.views.ArtistRegistration'
),

(r'^artists/login/$', 'madtrak.userprofiles.views.ArtistLoginRequest'),

(r'^artists/logout/$', 'madtrak.userprofiles.views.ArtistLogoutRequest'
),

(r'^artists/(?P[a-zA-Z0-9]+)/$', 
'madtrak.userprofiles.views.ArtistProfile'), 


Here are some relevant views.py functions:


# Artist Profile

def ArtistProfile(request, artistreq):

artist_object = Artist.objects.filter(artisturl = artistreq)

return render_to_response('artistprofile.html', {'Artist': 
artist_object}, context_instance = RequestContext(request))


and


# Artist Registration

def ArtistRegistration(request):

if request.user.is_authenticated():

return HttpResponseRedirect('/artists/profile')

if request.method == 'POST':

form = ArtistRegistrationForm(request.POST)

if form.is_valid():

# If information entered is valid create the user  

# user = User.objects.create_user('john', 
'len...@thebeatles.com', 'johnpassword')

artistusername = form.cleaned_data['artistusername']

artistemail = form.cleaned_data['artistemail']

artistpassword = form.cleaned_data['artistpassword']

artistuser = User.objects.create_user(username=artistusername, 
email=artistemail, password=artistpassword)

# Save new user to the database

artistuser.save()

artist = Artist(artistuser=artistuser, 
artistname=form.cleaned_data['artistname'], 
artistbirthday=form.cleaned_data['artistbirthday'], 
artisturl=form.cleaned_data['artisturl'])

artist.save()

return HttpResponseRedirect('/artists/profile/')

else:

return render_to_response('registerartist.html', {'form': 
form}, context_instance=RequestContext(request))

else:

''' user is not submitting the form, show the blank registration 
form '''

form = ArtistRegistrationForm()

context = {'form': form}

return render_to_response('registerartist.html', context, 
context_instance = RequestContext(request))


So, basically here is the caveat: If a user requests artists/register the 
site goes to hell. Why? well it's because as you might have guessed that 
request also fits the regex expression listed where I url config'd (r
'^artists/(?P[a-zA-Z0-9]+)/$', 
'madtrak.userprofiles.views.ArtistProfile'), 

and so the url config does not behave as I desired. Or if I requested 
likewise if you put artists/ [artistuser] it collides still with the rest 
of the url configs. So, my quick fix and was:


(r'^artists/register/$', 'madtrak.userprofiles.views.ArtistRegistration'
),

(r'^artists/login/$', 'madtrak.userprofiles.views.ArtistLoginRequest'),

(r'^artists/logout/$', 'madtrak.userprofiles.views.ArtistLogoutRequest'
),

(r'^artists/profile/(?P[a-zA-Z0-9]+)/$', 
'madtrak.userprofiles.views.ArtistProfile'), 


which thereby says hey if I only see artists/profile/ and then the 
requested artists profile then I behave as desired and return that artists 
public profile. Which makes sure it is obviously not listening at just 
artists/ [anything else]

Yet the thing is I REALLY want to be able to have it is I originally had 
it. I like how clean it is. I strongly desire the situation where I can 
host all the registration, login, logout, and any other systems that I 
desire following the artists/ but also want to be able to also cleanly host 
all artists usernames following the artists/ so that it properly querys the 
db and returns that artists profile.

I was thinking maybe I could hack this out with python regex or something 
of the like but is there a way in django to hack this together?

Thanks so much,

JJ

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Missing peice before best practises

2013-07-06 Thread Sayth Renshaw
Apologies Amirouche for the late reply.

The documentation is good, but I like many apparently(based on tutorials
for other envs) prefer a hands on approach to a documentary approach. This
is the place where Django doesn't have much depth in its ecosystem. It has
no current books and no hands on tutorial other than GSWD which creates a
lot of lifting with installing ruby, vms, vagrant and so on just to start
with Django.

Flask is starting to get a few tutorials popping up in real python for web,
http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world,
and in the works the Picard flask kickstarter
http://www.kickstarter.com/projects/1223051718/practical-flask-book-project.

I put my money where my mouth is and sponsor these kickstarters as there is
such a shortage of good info.

As I would back you Amirouche if you started a Kickstarter to give Django a
good practical and hands on tutorial.

Cheers

Sayth






On Thu, Jul 4, 2013 at 1:05 AM, Amirouche Boubekki <
amirouche.boube...@gmail.com> wrote:

>
>
>
> 2013/7/1 Sayth Renshaw 
>
>>
>>
>> On Monday, July 1, 2013, Tom Evans wrote:
>>
>>> On Mon, Jul 1, 2013 at 11:37 AM, Sayth Renshaw 
>>> wrote:
>>> > Is that good though?
>>> >
>>> > Barring 2 scoops there is no new material to recognise and guide users
>>> to
>>> > the new features of Django and to get beginner Django developers on
>>> board
>>> > quicker.
>>> >
>>> > It leads to bits of info for each python framework but nothing
>>> > comprehensive.
>>> >
>>> > Sayth
>>> >
>>>
>>> Virtualenv, pip etc are not features of Django, they are features of
>>> python. It is right that Django mentions them in places, it is doubly
>>> right that it does not attempt to duplicate the fine documentation
>>> that pip and virtualenv possess themselves.
>>>
>>> Cheers
>>>
>>> Tom
>>>
>>>
>> Agreed good tutorials would show steps and then point to resources for
>> further reading,
>>
>> At this point though it appears there is a scarcity of good tutorials for
>> current Django.
>>
>
> pip+virtualenv[wrapper] is a pratice not something that will allow you to
> build a skyrocket as-is, you can live without it.
>
> The documentation is good, and overall ecosystem alive and active, what do
> you need more ? They are several CMS and admin apps, blog solutions etc...
> They are still improvements and stabilisation to be done on many (utility)
> apps... Everything I want to say is that outside the django tutorial, and
> anybooks you read, the best way to improve your skills it to [re]build
> something...
>
> Time to time, I think about writring a set of tutorial about a CMS or
> Social Network from scratch, but experience says that except the actual
> code, the remaining issues are solved and well documented outside this
> virtual project, so this would, I think, have little value.
>
>
>
>
> HTH,
>
> Amirouche
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/f1RvG1vpVpg/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: CSRF verification failed

2013-07-06 Thread Sanjay Bhangar
On Sat, Jul 6, 2013 at 9:38 AM, Kakar Arunachal Service <
kakararunachalserv...@gmail.com> wrote:

> Hello!
> I am getting CSRF verification failed error, even after i added {%
> csrf_token %} tag in the html file.
>
> Here's my html file:
>
> {% extends "base.html" %}
> {% block title %} User Registration {% endblock %}
> {% block head %} User Registration {% endblock %}
> {% block content %}
> 
> {% csrf_token %}
> {{ form.as_p }}
> 
> 
> {% endblock %}
>
> and my views.py:
>
> def register_page(request):
> if request.method == 'POST':
> form = RegisrationForm(request.POST)
> if form.is_valid():
> user = User.objects.create_user(
> username = form.cleaned_data['username'],
> password = form.cleaned_data['password1'],
> email = form.cleaned_data['email']
> )
> return HttpResponseRedirect('/')
> else:
> form = RegisrationForm()
> variables = RequestContext(request, {
> 'form': form
> })
> return render_to_response('registration/register.html',
> variables)
> else:
> return render_to_response('registration/register.html')
>
> else:
  return render_to_response("registration/register.html",
RequestContext(request, {})


> Where am i doing wrong???
>

In your outer else statement, you need to return a RequestContext instance
..

You could also use the 'render' shortcut:
from django.shortcuts import render

.

return render(request, "registration/register.html")

Basically, you need to make sure the template has the context created by
RequestContext, otherwise csrf_token will not be available as a variable on
the template.

Hope that helps,
Sanjay



>
>  --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Managing transactions using multiple databases

2013-07-06 Thread Christophe Pettus

On Jul 6, 2013, at 8:58 PM, Leandro Boscariol wrote:
> And also thanks for mentioning xact, I wasn't aware of that!

Full disclosure: I wrote it. :)  In 1.6, the new atomic() decorator / context 
manager is the way to go, but xact() works fine for now!

--
-- Christophe Pettus
   x...@thebuild.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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Managing transactions using multiple databases

2013-07-06 Thread Leandro Boscariol
Well, even though without true two-phase commit, for now that will do, 
thanks.

And also thanks for mentioning xact, I wasn't aware of that!

Cheers,
Leandro

On Saturday, July 6, 2013 10:41:11 AM UTC-3, Christophe Pettus wrote:
>
>
> On Jul 6, 2013, at 2:54 PM, Leandro Boscariol wrote: 
>
> > How can I do a transaction management in both databases at the same 
> time? Is that even possible? 
>
> You can certainly nest the transaction context managers (atomic() in 1.6+, 
> or you can use xact() in 1.5 and earlier): 
>
>with xact(using=DATABASE1): 
>   with xact(using=DATABASE2): 
>  things 
>
> If an exception occurs, it will rollback both; if it exits normally, it 
> will commit both.  Note that this isn't true two-phase commit; it's 
> perfectly possible for the inner transaction to successfully commit but the 
> outer one to fail.  If you want proper two-phase commit, you'll (at the 
> moment, at least) have to roll your own. 
>
> -- 
> -- Christophe Pettus 
>x...@thebuild.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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Issue in User authentication

2013-07-06 Thread vijay shanker


On Thursday, July 4, 2013 11:30:06 PM UTC+5:30, vijay shanker wrote:
>
> *Hi*
> *I am using django 1.5 and created my own user model by AUTH_USER_MODEL= 
> 'account.User' in settings.*
>
> *my user model is like this:*
>
> from django.db import models
> from django.contrib.auth.models import AbstractBaseUser, UserManager, 
> PermissionsMixin
> # Create your models here.
> GENDER = (
> ('M', 'Male'),
> ('F', 'Female')
> )
>
> class User(AbstractBaseUser, PermissionsMixin):
> username = models.CharField(max_length=100, unique=True)
> first_name = models.CharField(max_length=100)
> last_name = models.CharField(max_length=100)
> email = models.EmailField(unique=True)
> gender = models.CharField(max_length=10, choices=GENDER)
> is_admin = models.BooleanField(default=False)
> is_staff = models.BooleanField(default=False)
> is_active = models.BooleanField(default=False)
> date_joined = models.DateTimeField(auto_now_add=True)
> 
> objects = UserManager()
> 
> USERNAME_FIELD = 'email'
> REQUIRED_FIELDS = ['username']
> 
> def __unicode__(self):
> return self.get_full_name()
> 
> 
> def get_full_name(self):
> return ' '.join([self.first_name, self.last_name]) or self.username
> 
> def get_short_name(self):
> return self.first_name or self.username.
>
> The form which i present to user for signup is:
>
> class SignupForm(forms.ModelForm):
> class Meta:
> model = User
> fields = ['username', 'first_name', 'last_name', 'email', 
> 'gender', 'password']
> exclude = ['last_login', 
> 'is_superuser','groups','user_permissions', 'is_admin', 'is_staff', 
> 'is_active']
> widgets = {
> 'password': forms.PasswordInput(),
> }
> 
> def save(self):
> user = super(SignupForm, self).save(commit=False)
> user.set_password(self.cleaned_data['password'])
> user.save(commit=True)
> return user
>
>
> *my login view function is like this:*
>
> class LoginView(View):
> def get(self, request, *args, **kwargs):
> form = LoginForm()
> return render_to_response('login.html', 
> {'form':form},context_instance = RequestContext(request) )
> 
> def post(self,request,*args, **kwargs ):
> username = self.request.POST['username']
> password = self.request.POST['password']
> user = authenticate(username=username, password=password)
> 
> if user is not None:
> if user.is_active:
> print "You provided a correct username and password!"
> login(request, user)
> return redirect(reverse('bands-list'))
> else:
> login(request, user)
> print "Your account has been disabled!"
> return redirect(reverse('bands-list'))
> else:
> form = LoginForm()
> return render_to_response('login.html', 
> {'form':form},context_instance = RequestContext(request) )
>
> *and somewhere in my template:*
>
> {% if request.user.is_authenticated %}
> hello {{ user.first_name }}  >Logout
> {% else %}
> Login
> Signup
> {% endif %}
>
> *the problem i am facing are:*
> *
> *
> *1. when the user signs up, password stored are not encrypted, ( though i 
> am overriding save() to do so above)*
>
 * there is no commit for user.save(); your whole code isn't even executed 
since save has to be a method on the form not of meta*

> *2. though i provide correct password, request.user.is_authenticated does 
> not works for me.*
> *its only user.is_authenticated in template and not 
> request.user.is_authenticated
> *
> kind suggestions are welcome.
> Regards
> Vijay Shanker
>
>
>
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




CSRF verification failed

2013-07-06 Thread Kakar Arunachal Service
Hello!
I am getting CSRF verification failed error, even after i added {%
csrf_token %} tag in the html file.

Here's my html file:

{% extends "base.html" %}
{% block title %} User Registration {% endblock %}
{% block head %} User Registration {% endblock %}
{% block content %}

{% csrf_token %}
{{ form.as_p }}


{% endblock %}

and my views.py:

def register_page(request):
if request.method == 'POST':
form = RegisrationForm(request.POST)
if form.is_valid():
user = User.objects.create_user(
username = form.cleaned_data['username'],
password = form.cleaned_data['password1'],
email = form.cleaned_data['email']
)
return HttpResponseRedirect('/')
else:
form = RegisrationForm()
variables = RequestContext(request, {
'form': form
})
return render_to_response('registration/register.html',
variables)
else:
return render_to_response('registration/register.html')

Where am i doing wrong???

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Advanced search in django?

2013-07-06 Thread Kamal Kaur
On Sat, Jul 6, 2013 at 9:39 PM, Javier Guerra Giraldez
 wrote:
> not a separate file, but a separate field.  either override the save()
> method of your model, or connect to the pre_save() signal to keep it
> updated with the 'original' text.  for searches simply query this
> field against the soundex of the input.
>
> don't forget to add an index to the soundex field

Sorry, didn't get you.
Can you please elaborate more?

--
Kamaljeet Kaur

Blog:http://kamalkaur188.wordpress.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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Advanced search in django?

2013-07-06 Thread Javier Guerra Giraldez
On Sat, Jul 6, 2013 at 11:04 AM, Kamal Kaur  wrote:
> But don't know how to implement it in my project to
> search in database. Do I need to keep a
> separate file? or what to do ?


not a separate file, but a separate field.  either override the save()
method of your model, or connect to the pre_save() signal to keep it
updated with the 'original' text.  for searches simply query this
field against the soundex of the input.

don't forget to add an index to the soundex field

--
Javier

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Advanced search in django?

2013-07-06 Thread Kamal Kaur
I have found the code for Soundex which is a phonetic algorithm, it is
capable of searching from database despite of minor spelling
differences. But don't know how to implement it in my project to
search in database. Do I need to keep a
separate file? or what to do ?
Here is the link.
https://github.com/japerk/nltk-trainer/blob/76d538aa35f6b311b7ce68879b543e0602d1a7cf/nltk_trainer/featx/phonetics.py


--
Kamaljeet Kaur

Blog:http://kamalkaur188.wordpress.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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Rendering 3D model in a Django app

2013-07-06 Thread Javier Guerra Giraldez
On Sat, Jul 6, 2013 at 9:03 AM, Sergiy Khohlov  wrote:
> you need to use webgl  for client side


a popular JavaScript library for handling WebGL is three.js
(http://threejs.org).  it supports several input 3D formats, VTK and
OBJ among them.

--
Javier

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: redirct page

2013-07-06 Thread Kakar Arunachal Service
thank you much! That did solved the problem!


On Sat, Jul 6, 2013 at 7:15 PM, Black9design.com wrote:

> I noticed in the snippet that you provided that it says "form methon". See
> if that is the issue.
>
> On Jul 6, 2013, at 6:29 AM, Kakar Arunachal Service <
> kakararunachalserv...@gmail.com> wrote:
>
> Hello! Thanks for the correction! But even after the {% csrf_token %} tag
> its not redirecting to the main index page. :(
>
>
> On Sat, Jul 6, 2013 at 6:45 PM, Tomas Ehrlich wrote:
>
>> Hi there,
>> you're certaily missing {% csfr_token %} in your form.
>>
>> If it doesn't solve the problem, you need to provide more info and be
>> more specific about your "trouble".
>>
>> Dne Sat, 6 Jul 2013 17:44:04 +0530
>> Kakar Arunachal Service  napsal(a):
>>
>> > Hi,
>> > I am having trouble with redirecting the login page to index page.
>> Please
>> > guide me.
>> >
>> > Here's the html snippet:
>> > 
>> > User Login
>> > {% if form.errors %}
>> > Your username and password didn't match.
>> > Please try again.
>> > {% endif %}
>> > 
>> > Username:{{
>> form.username
>> > }}
>> > Password:{{
>> form.password
>> > }}
>> > 
>> > 
>> > 
>> > 
>> >
>> > Thanks.
>> >
>>
>> --
>> 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 post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>  --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
>  --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Rendering 3D models which change based on the interaction from Users. in Django

2013-07-06 Thread Sergiy Khohlov
pass few webGL lesson and adopt django templeta to it. Unfortunately I have
not made this yet

Many thanks,

Serge


+380 636150445
skype: skhohlov


On Sat, Jul 6, 2013 at 1:30 PM, Rohit kumar  wrote:

> I am using Django and want to create a page which should render a
> interactive 3D model for the user. I have the obj file which I can even use
> as csv or excel sheet. Kindly help how to do an interactive page which
> renders 3D model
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Is there a way to automatically assign URLs based on view names?

2013-07-06 Thread Javier Guerra Giraldez
On Sat, Jul 6, 2013 at 3:48 AM, R. Eastbourne  wrote:
> I would like these URLs assigned automatically.


i've done this once.  crude, but works ok:

-- at the end of urls.py --

def _simpleurl(viewname, mod):
return url ('^%s/$'%viewname, getattr(mod, viewname), name=viewname)

urlpatterns += patterns ('', *(_simpleurl(vn,views) for vn in
views.simpleviews))

---


where views.simpleviews is a list of function names defined in views.py.


--
Javier

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Rendering 3D model in a Django app

2013-07-06 Thread Sergiy Khohlov
Check this one
http://theresa.multimediatechnology.at/webgl-demonstrator-rendering-vtk-in-native-3d/

you need to use webgl  for client side. your question is not related to
django directly.

Many thanks,

Serge


+380 636150445
skype: skhohlov


On Sat, Jul 6, 2013 at 2:44 PM, Rohit kumar  wrote:

> I have a 3D obj model created using VTK and want to render it my Mezzanine
> page. How to do that. Kindly 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: redirct page

2013-07-06 Thread Black9design.com
I noticed in the snippet that you provided that it says "form methon". See if 
that is the issue.

On Jul 6, 2013, at 6:29 AM, Kakar Arunachal Service 
 wrote:

> Hello! Thanks for the correction! But even after the {% csrf_token %} tag its 
> not redirecting to the main index page. :(
> 
> 
> On Sat, Jul 6, 2013 at 6:45 PM, Tomas Ehrlich  wrote:
>> Hi there,
>> you're certaily missing {% csfr_token %} in your form.
>> 
>> If it doesn't solve the problem, you need to provide more info and be more 
>> specific about your "trouble".
>> 
>> Dne Sat, 6 Jul 2013 17:44:04 +0530
>> Kakar Arunachal Service  napsal(a):
>> 
>> > Hi,
>> > I am having trouble with redirecting the login page to index page. Please
>> > guide me.
>> >
>> > Here's the html snippet:
>> > 
>> > User Login
>> > {% if form.errors %}
>> > Your username and password didn't match.
>> > Please try again.
>> > {% endif %}
>> > 
>> > Username:{{ form.username
>> > }}
>> > Password:{{ form.password
>> > }}
>> > 
>> > 
>> > 
>> > 
>> >
>> > Thanks.
>> >
>> 
>> --
>> 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 post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> For more options, visit https://groups.google.com/groups/opt_out.
> 
> -- 
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: redirct page

2013-07-06 Thread François Schiettecatte
Well 'methon' should be 'method', probably does not bother the browser though, 
but redirection is something that is issued by your app, not the form.

You should check:

https://docs.djangoproject.com/en/1.5/topics/http/shortcuts/#redirect



On Jul 6, 2013, at 9:29 AM, Kakar Arunachal Service 
 wrote:

> Hello! Thanks for the correction! But even after the {% csrf_token %} tag its 
> not redirecting to the main index page. :(
> 
> 
> On Sat, Jul 6, 2013 at 6:45 PM, Tomas Ehrlich  wrote:
> Hi there,
> you're certaily missing {% csfr_token %} in your form.
> 
> If it doesn't solve the problem, you need to provide more info and be more 
> specific about your "trouble".
> 
> Dne Sat, 6 Jul 2013 17:44:04 +0530
> Kakar Arunachal Service  napsal(a):
> 
> > Hi,
> > I am having trouble with redirecting the login page to index page. Please
> > guide me.
> >
> > Here's the html snippet:
> > 
> > User Login
> > {% if form.errors %}
> > Your username and password didn't match.
> > Please try again.
> > {% endif %}
> > 
> > Username:{{ form.username
> > }}
> > Password:{{ form.password
> > }}
> > 
> > 
> > 
> > 
> >
> > Thanks.
> >
> 
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
> 
> 
> 
> 
> -- 
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Managing transactions using multiple databases

2013-07-06 Thread Christophe Pettus

On Jul 6, 2013, at 2:54 PM, Leandro Boscariol wrote:

> How can I do a transaction management in both databases at the same time? Is 
> that even possible?

You can certainly nest the transaction context managers (atomic() in 1.6+, or 
you can use xact() in 1.5 and earlier):

   with xact(using=DATABASE1):
  with xact(using=DATABASE2):
 things

If an exception occurs, it will rollback both; if it exits normally, it will 
commit both.  Note that this isn't true two-phase commit; it's perfectly 
possible for the inner transaction to successfully commit but the outer one to 
fail.  If you want proper two-phase commit, you'll (at the moment, at least) 
have to roll your own.

--
-- Christophe Pettus
   x...@thebuild.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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: redirct page

2013-07-06 Thread Kakar Arunachal Service
Hello! Thanks for the correction! But even after the {% csrf_token %} tag
its not redirecting to the main index page. :(


On Sat, Jul 6, 2013 at 6:45 PM, Tomas Ehrlich wrote:

> Hi there,
> you're certaily missing {% csfr_token %} in your form.
>
> If it doesn't solve the problem, you need to provide more info and be more
> specific about your "trouble".
>
> Dne Sat, 6 Jul 2013 17:44:04 +0530
> Kakar Arunachal Service  napsal(a):
>
> > Hi,
> > I am having trouble with redirecting the login page to index page. Please
> > guide me.
> >
> > Here's the html snippet:
> > 
> > User Login
> > {% if form.errors %}
> > Your username and password didn't match.
> > Please try again.
> > {% endif %}
> > 
> > Username:{{
> form.username
> > }}
> > Password:{{
> form.password
> > }}
> > 
> > 
> > 
> > 
> >
> > Thanks.
> >
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: redirct page

2013-07-06 Thread Tomas Ehrlich
Hi there,
you're certaily missing {% csfr_token %} in your form.

If it doesn't solve the problem, you need to provide more info and be more 
specific about your "trouble".

Dne Sat, 6 Jul 2013 17:44:04 +0530
Kakar Arunachal Service  napsal(a):

> Hi,
> I am having trouble with redirecting the login page to index page. Please
> guide me.
> 
> Here's the html snippet:
> 
> User Login
> {% if form.errors %}
> Your username and password didn't match.
> Please try again.
> {% endif %}
> 
> Username:{{ form.username
> }}
> Password:{{ form.password
> }}
> 
> 
> 
> 
> 
> Thanks.
> 

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: redirct page

2013-07-06 Thread Amirouche Boubekki
Hi,

Redirection is done in the view after form processing et al. with redirect
shortcut


2013/7/6 Kakar Arunachal Service 

> Hi,
> I am having trouble with redirecting the login page to index page. Please
> guide me.
>
> Here's the html snippet:
> 
> User Login
> {% if form.errors %}
> Your username and password didn't match.
> Please try again.
> {% endif %}
> 
> Username:{{
> form.username }}
> Password:{{
> form.password }}
> 
> 
> 
> 
>
> Thanks.
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Managing transactions using multiple databases

2013-07-06 Thread Leandro Boscariol
Hello,

During the design of a project, I came across a situation where I will have 
2 databases.
Not a big deal, it is very well documented in Django 
docs
.

Dealing with 
transactionseven 
when having multiple databases is also trivial, simply select which 
one the transaction is about.

At a given point, I'll have to interact with both databases in the same 
view.
Consider the snippet below as an example (not tested, nor this is what I 
intend to do):

@transaction.commit_manually()  # using='db1' or using='db2' or none??
def my_view(request):
try:
obj1 = MyObject1()
obj1.data = request.POST.get('data')
obj1.save(using='db1')
obj2 = MyObject2()
obj2.obj1_id = obj1id
obj2.save(using='db2')
except:
transaction.rollback()
else:
transaction.commit()
...


I didn't find any mention in the docs or in this list related to this, so 
here is my question:

How can I do a transaction management in both databases at the same time? 
Is that even possible?


Thanks in advance for your help.
Leandro.

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




redirct page

2013-07-06 Thread Kakar Arunachal Service
Hi,
I am having trouble with redirecting the login page to index page. Please
guide me.

Here's the html snippet:

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

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





Thanks.

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Rendering 3D models which change based on the interaction from Users. in Django

2013-07-06 Thread Rohit kumar
I am using Django and want to create a page which should render a 
interactive 3D model for the user. I have the obj file which I can even use 
as csv or excel sheet. Kindly help how to do an interactive page which 
renders 3D model

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Rendering 3D model in a Django app

2013-07-06 Thread Rohit kumar
I have a 3D obj model created using VTK and want to render it my Mezzanine 
page. How to do that. Kindly 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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




type object 'DataTable' has no attribute 'datFile'

2013-07-06 Thread Nigel Legg
I have the following code:
models.py:
class DataTable(models.Model):
datFile = models.CharField(max_length = 200)
structFile = models.CharField(max_length = 200)
bannerVar = models.CharField(max_length = 50)
stubVar = models.CharField(max_length = 50)
stubNets = models.BooleanField()

def __unicode__(self):
return u'%s %s %s %s' % (self.datFile, self.structFile,
self.bannerVar, self.stubVar)

forms.py:
class DataTableForm(forms.ModelForm):

class Meta:

model = DataTable

views.py:
def datatables(request):
if request.method == 'POST':
form = DataTableForm(request.POST)
if form.is_valid():
form.save()
return redirect('myapp/tabspec.html')
else:
form = DataTableForm()
return render(request, 'myapp/datatables.html', {
'form': form,
})

def tabspec(request):
try:
datFile = DataTable.datFile
context = Context({
'datFile': datFile,
})
except DataTable.DoesNotExist:
raise Http404
return HttpResponse(template.render(context))

The DataTable view shows, as a form; I enter the values for the ields, when
I click the button, I get the error "type object 'DataTable' has no
attribute 'datFile'".  I thought maybe I should be referring to
DataTableForm.datFile, but this gave the same error.
I am confused, could any one tell me where I am going wrong?
Regards,
Nigel Legg
07914 740972
http://www.treavnianlegg.co.uk
http://twitter.com/nigellegg
http://uk.linkedin.com/in/nigellegg

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Is there a way to automatically assign URLs based on view names?

2013-07-06 Thread R. Eastbourne
I would like all my URLs to follow this schema: appname/ClassBasedViewName. 
I don't want to have to update urls.py every time I change my views, so I 
would like these URLs assigned automatically. Is there an existing module 
that is capable of doing this? (Otherwise I will write my own, using 
os.path to get the app name and Class.__name__ to get the view name, but 
there are a couple of potentially tricky pieces of code I may have to 
write.)

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Soundex

2013-07-06 Thread Harjot Mann


On Friday, February 8, 2008 2:41:15 AM UTC+5:30, Jacob Kaplan-Moss wrote:
On 2/7/08, leith...@gmail.com  > 
wrote:
> User.objects.filter(first_name__sounds_like="John")
>
> which would produce and SQL statement like:
>
> WHERE DIFF(SOUNDEX(first_name), SOUNDEX("John")) >= 3
>
> Any plans for it?

As a built-in, probably not -- it is indeed somewhat db-specific, and
if we started added magic lookups for every possible query type we'd
never get anything else done. Luckily, it's very easy to do manually::

User.objects.extra(
where=["DIFF SOUNDEX(first_name), SOUNDEX(%s)) >=3"],
params=["John"]
)

Jacob

It is not working like this.

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Error in Autoamation

2013-07-06 Thread Harjot Mann
On Sat, Jul 6, 2013 at 1:12 PM, Nigel Legg  wrote:
> Make sure the two variables you are trying to combine are the same datatype.
> This is in the python docs, and not a django problem.


ok.

--
Harjot Kaur Mann
Blog: http://harjotmann.wordpress.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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Soundex in django

2013-07-06 Thread Harjot Mann
How to import soundex in django??
--
Harjot Kaur Mann
Blog: http://harjotmann.wordpress.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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Error in Autoamation

2013-07-06 Thread Nigel Legg
Make sure the two variables you are trying to combine are the same
datatype.  This is in the python docs, and not a django problem.

Regards,
Nigel Legg
07914 740972
http://www.treavnianlegg.co.uk
http://twitter.com/nigellegg
http://uk.linkedin.com/in/nigellegg



On 6 July 2013 08:40, Harjot Mann  wrote:

> On Fri, Jul 5, 2013 at 4:46 PM, Nigel Legg  wrote:
> > You can't combine int and unicode. Seems you are trying to.
>
> Yes I am adding int with another datatype. What should I do to remove
> this error?
>
>
> --
> Harjot Kaur Mann
> Blog: http://harjotmann.wordpress.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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Error in Autoamation

2013-07-06 Thread Harjot Mann
On Fri, Jul 5, 2013 at 4:46 PM, Nigel Legg  wrote:
> You can't combine int and unicode. Seems you are trying to.

Yes I am adding int with another datatype. What should I do to remove
this error?


--
Harjot Kaur Mann
Blog: http://harjotmann.wordpress.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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.