soundx algo in search

2013-07-09 Thread Harjot Mann
Below is  the soundex algorithm in python. I want to implement it in
my search function, please help me how it will work for my search.
http://tny.cz/8d5ba06f

--
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: Return 2 values

2013-07-09 Thread Masklinn
On 2013-07-08, at 13:26 , Hélio Miranda wrote:
> ok, I have my view like this:
> *def view(request, id):*
> *fs = mongoengine.fields.GridFSProxy()*
> *foto = fs.get(id=ObjectId(id))*
> *legenda = foto.legend*
> **
> *array = [foto.read(), legenda]*
> *return HttpResponse(array)*
> 
> But before I had to go to the image url this:
> *url(r'^view/\w+)>', 'rest.views.view'),*
> 
> And now for access to the image and caption will as I do?

Look, you can't do that, you're returning a Response directly which
means this is an HTTP resource and HTTP does not work this way, you
can't return multiple HTTP resources at once.

So you've got two choices:
* Return a master resource (an HTML page with the caption) and have *it*
  fetch the picture separately
* Return an embedding resource, an HTML page with the caption and the
  image data embedded as base64.

You might also be able to embed the caption in the image metadata
(e.g. the Exif.Image.ImageDescription or Exif.Photo.UserComment fields)
but I don't know any browser which'd display these.

The second will be way less bandwidth-efficient, though it will save a
single HTTP roundtrip.

For some reason I don't get Nick has been talking about Python-level
returning multiple values, that will not work.

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




Alter "Select Object to change" for change list

2013-07-09 Thread nesornet
Is there a way to adjust the "Select Object to change" text shown above 
table in change lists?
I ran across some similar posts that opted to modify the django core for 
this adjustment, but I was wondering if
a cleaner solution has become available for django 1.5.1.

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: Javascript AJAX url call not responding

2013-07-09 Thread nesornet
OK. I found the solution and hope this description prevents someone else 
from having to deal with this pain in the ass gotcha. "Gotcha" for me 
anyhow :)

So if your ajax target resides in the urls.py of some module somewhere (in 
this case persistent_messages)
and your referencing it from an SSL protected page, then you must add the 
{'SSL:'True} argument to the appropriate
urls.py line. In this particular case, updating persistent_messages/urls.py:

url(r'^mark_read/(?P\d+)/$', 
'persistent_messages.views.message_mark_read', {'SSL': True}, 
name='message_mark_read'),

resolved the issue and allowed the ajax call to the above url to finally 
succeed.

Remember that the behavior otherwise (without SSL:True argument) results in 
the ajax status immediately going to CANCELLED or forever PENDING without 
ever getting a response (nor django errors, nor apache errors)


On Thursday, July 4, 2013 9:03:33 PM UTC-5, neso...@ymail.com wrote:
>
> So I have django 1.5.1 installed,
> have persistent messages installed, and have messages displaying in a list
> via the template reference {% include 
> "persistent_messages/message/includes/messages.jquery.html" %}
>
> The following javascript click trigger is bound to an anchor tag within 
> the list:
>
> $(closeSelector).click(function(event) {
> event.preventDefault();
> $.ajax({
> url: "//url.com/"+$(this).attr('href')
> })
> if ($(messageSelector).length <= 2) {
> $(closeAllSelector).messageClose();
> }
>
> $(this).closest(messageSelector).messageClose();
> });
>
> The link being referenced is https://url.com/messages/mark_read/583/ 
> If I access that same link manually in the address bar, the appropriate 
> call in the backend
> gets executed and the message is marked read. The ajax equivalent never 
> seems to respond.
> I added logging to the persistent messages view and confirmed the ajax 
> call is never
> calling mark_read() method.
>
> Chrome dev tools indicates that the ajax call is "pending" and never 
> changes from this state.
>
> Any suggestions or ideas on what may be causing this?
>
> NOTE: I prepend the "//url.com" to avoid getting 'insecure content' 
> warnings, since this ajax code is being executed
> from a https page. This change did not seem to affect the bug in any way, 
> since the response is the same.
>
> 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.




django graphics

2013-07-09 Thread amanjot kaur
Please suggest me some module/library in django to plot graphs which
takes input from user.
--
Amanjot Kaur

Blog: kauramanjot35.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.




Button/URL admin Django interface

2013-07-09 Thread Giorgos Kontogiorgakis
Hello everyone!

I am trying to add a button or a URL on my main admin Django interface so i 
can call a script from this button/url without executing this by 
terminal/command line.Is there any easy way to do this?I am pretty new to 
Django and python and i had a break on my project for around a month cause 
of a health problem.Any example or help is really appreciated.

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

2013-07-09 Thread Nigel Legg
I was going to look at Django Chartit -
http://chartit.shutupandship.com/for this, unless anyone has better
suggestions?

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



On 9 July 2013 08:39, amanjot kaur  wrote:

> Please suggest me some module/library in django to plot graphs which
> takes input from user.
> --
> Amanjot Kaur
>
> Blog: kauramanjot35.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: Button/URL admin Django interface

2013-07-09 Thread Sandro Dutra
Probably you've to edit the admin base template, only this.


2013/7/9 Giorgos Kontogiorgakis 

> Hello everyone!
>
> I am trying to add a button or a URL on my main admin Django interface so
> i can call a script from this button/url without executing this by
> terminal/command line.Is there any easy way to do this?I am pretty new to
> Django and python and i had a break on my project for around a month cause
> of a health problem.Any example or help is really appreciated.
>
> --
> 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.




Problem in uploading MultiValueDictKeyError

2013-07-09 Thread Hélio Miranda
Good!
I'm having a strange problem, which is this, I have uploaded all ok and 
working.
HTML:
*  *
**
*   *
*{% block title%} {% endblock%} *
*   *
*   *
*{% Block content%} {% endblock%}*
*  *
*  Csrf_token% {%}*
**
*   Submit   *
*   *
**

Views:
*def upload (request, id):*
*
*
* if request.method == 'POST':*
**
* my_painting Movie.objects.get = (id = id)*
**
* files = []*
* request.FILES.getlist for f in ('file'):*
*mf = mongoengine.fields.GridFSProxy ()*
*mf.put (f, filename = f.name)*
*
*
*files.append (mf)*
*my_painting.MovieCover = files*
* my_painting.save ()*
*
*
* return render_to_response ('upload.html', {},*
*   context_instance = RequestContext (request))
*

But to put my code in the repository to my colleague interconnect 
interface, the pc it gives the following error:
*MultiValueDictKeyError at / upload/51dbdc3efadcd20d8cad9249*
'Key' Legend 'not found in  "

Does anyone know what could be?

-- 
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: Problem in uploading MultiValueDictKeyError

2013-07-09 Thread Nigel Legg
You have
*Csrf_token% {%}

*
shouldn't it be

*{% csrf_token %}*

???




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



On 9 July 2013 13:10, Hélio Miranda  wrote:

> Good!
> I'm having a strange problem, which is this, I have uploaded all ok and
> working.
> HTML:
> *  *
> **
> *   *
> *{% block title%} {% endblock%} *
> *   *
> *   *
> *{% Block content%} {% endblock%}*
> *  *
> *  Csrf_token% {%}*
> **
> *   Submittr>*
> *   *
> **
>
> Views:
> *def upload (request, id):*
> *
> *
> * if request.method == 'POST':*
> **
> * my_painting Movie.objects.get = (id = id)*
> **
> * files = []*
> * request.FILES.getlist for f in ('file'):*
> *mf = mongoengine.fields.GridFSProxy ()*
> *mf.put (f, filename = f.name)*
> *
> *
> *files.append (mf)*
> *my_painting.MovieCover = files*
> * my_painting.save ()*
> *
> *
> * return render_to_response ('upload.html', {},*
> *   context_instance = RequestContext
> (request))*
>
> But to put my code in the repository to my colleague interconnect
> interface, the pc it gives the following error:
> *MultiValueDictKeyError at / upload/51dbdc3efadcd20d8cad9249*
> 'Key' Legend 'not found in  [u'ttink2Z7gz3VXu1CwruYeZ2Cnq5x7uNy']}> "
>
> Does anyone know what could be?
>
> --
> 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: Button/URL admin Django interface

2013-07-09 Thread Giorgos Kontogiorgakis
Any example of how to do this or any link that can help me with that?


On Tuesday, July 9, 2013 3:00:04 PM UTC+3, Giorgos Kontogiorgakis wrote:
>
> Hello everyone!
>
> I am trying to add a button or a URL on my main admin Django interface so 
> i can call a script from this button/url without executing this by 
> terminal/command line.Is there any easy way to do this?I am pretty new to 
> Django and python and i had a break on my project for around a month cause 
> of a health problem.Any example or help is really appreciated.
>

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




Creating a Node in Django ORM

2013-07-09 Thread Nafiul Islam
How would you create a node using Django's ORM. This is what I mean: 
https://dpaste.de/JG52c/

Now, what I am basically trying to create is a liked list with nodes here.

-- 
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: Creating a Node in Django ORM

2013-07-09 Thread Elliot Bradbury
Check out django-mptt for creating parent/child (tree) relationships
between models. https://github.com/django-mptt/django-mptt


On Tue, Jul 9, 2013 at 9:07 AM, Nafiul Islam wrote:

> How would you create a node using Django's ORM. This is what I mean:
> https://dpaste.de/JG52c/
>
> Now, what I am basically trying to create is a liked list with nodes here.
>
> --
> 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: Problem in uploading MultiValueDictKeyError

2013-07-09 Thread Hélio Miranda
ah yes, it was me who got sick. But the code is correct

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




Admin Fields : add an icon "not display on website" to fields

2013-07-09 Thread Jérémie Ferry
Hi,

I want to add to some fields a little icon "not display on website" in my 
Admin interface.

What the best way to do 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: Problem in uploading MultiValueDictKeyError

2013-07-09 Thread Daniel Roseman
On Tuesday, 9 July 2013 14:16:59 UTC+1, Hélio Miranda wrote:

> ah yes, it was me who got sick. But the code is correct
>

You really need to post your actual code. There are at least two other 
errors there ( *.get = (id = id) *and * **request.FILES.getlist*) which 
mean your code would not run. Since you don't show any reference to 
'Legend' in your the code you post, we are left wondering if that's 
something you've missed out when you posted, or if it's being called from 
somewhere you have posted. The other thing that would help us is the actual 
traceback that Django shows: it's not just random nonsense, it actually 
shows where the error is being generated.
--
DR.

-- 
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: Creating a Node in Django ORM

2013-07-09 Thread Gamesbrainiac
Thanks for answering, but is there a simple way that does not use a
third-party library? I'd like to have as much control over this as possible.


On 9 July 2013 19:11, Elliot Bradbury  wrote:

> Check out django-mptt for creating parent/child (tree) relationships
> between models. https://github.com/django-mptt/django-mptt
>
>
> On Tue, Jul 9, 2013 at 9:07 AM, Nafiul Islam wrote:
>
>> How would you create a node using Django's ORM. This is what I mean:
>> https://dpaste.de/JG52c/
>>
>> Now, what I am basically trying to create is a liked list with nodes here.
>>
>> --
>> 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 a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/wvXc7VehovQ/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.
>
>
>



-- 
Kind Regards,

Quazi Nafiul Islam

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




django graphics

2013-07-09 Thread amanjot kaur
Please suggest me some module/library in django to plot graphs which
takes input from user.

-- 
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: Problem in uploading MultiValueDictKeyError

2013-07-09 Thread Hélio Miranda
my code is
HTML:
* *
**
**
*  {% block title %}{% endblock %}*
*   *
*  *
* {% block content %}{% endblock %}*
*  *
*  {% csrf_token %}*
* *
* Submit*
*  *
**
*
*
Views:
*def upload(request, id):*
*
*
*if request.method == 'POST':*
**
*my_painting = Movie.objects.get(id=id)*
**
*files = []*
*for f in request.FILES.getlist('file'):*
*   mf = mongoengine.fields.GridFSProxy()*
*   mf.put(f, filename=f.name)*
*
*
*   files.append(mf)*
*   my_painting.MovieCover = files*
*my_painting.save()*
*
*
*return render_to_response('upload.html', {},*
*  context_instance=RequestContext(request))*

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

2013-07-09 Thread John
On 09/07/13 14:30, amanjot kaur wrote:
> Please suggest me some module/library in django to plot graphs which
> takes input from user. --
Amanjot,

There are many python plotting libraries. I usually use matplotlib
because my plots tend to be quite technical.

John

-- 
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: Creating a Node in Django ORM

2013-07-09 Thread John
Nafiul,

Either dig into the django-mptt code and pull out the bits you need, or
look at MPTT and roll your own.
http://www.sitepoint.com/hierarchical-data-database-2/ has a reasonable
explanation (with code written in some archaic script ;) ) of how MPTT
works.

John


On 09/07/13 14:26, Gamesbrainiac wrote:
> Thanks for answering, but is there a simple way that does not use a
> third-party library? I'd like to have as much control over this as
> possible.
>
>
> On 9 July 2013 19:11, Elliot Bradbury  > wrote:
>
> Check out django-mptt for creating parent/child (tree)
> relationships between
> models. https://github.com/django-mptt/django-mptt
>
>
> On Tue, Jul 9, 2013 at 9:07 AM, Nafiul Islam
> mailto:gamesbrain...@gmail.com>> wrote:
>
> How would you create a node using Django's ORM. This is what I
> mean: https://dpaste.de/JG52c/
>
> Now, what I am basically trying to create is a liked list with
> nodes here.
> -- 
> 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 a topic in
> the Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/wvXc7VehovQ/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.
>  
>  
>
>
>
>
> -- 
> Kind Regards,
>
> Quazi Nafiul Islam
> -- 
> 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: Creating a Node in Django ORM

2013-07-09 Thread John
On 09/07/13 14:07, Nafiul Islam wrote:
> How would you create a node using Django's ORM. This is what I
> mean: https://dpaste.de/JG52c/
>
> Now, what I am basically trying to create is a liked list with nodes here.
>
Nafiul,

>From your code snippet, it looks like you are trying to create a tree.
Look at django-mptt or google "django tree" for more information.

If you are trying to do a linked list, with 'previous' and 'next'
pointers, they just need to go in as foreign keys, but see
https://docs.djangoproject.com/en/1.5/ref/models/fields/#django.db.models.ForeignKey.related_name
because you will need to use the related_name attribute to make the
foreign key relationships distinct from each other. You will also need a
List object that holds the head (and perhaps tail) pointers for the list.

John

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




Add an icon "not displayed on website" to certain fields on Admin interface.

2013-07-09 Thread Jérémie Ferry
Add an icon "not displayed on website" to certain fields on Admin interface.

The best idea would be to override Fields properties without touching the 
code of it. (for example : on an external app)

How to do that properly?

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

2013-07-09 Thread amanjot kaur


>
>
> There are many python plotting libraries. I usually use matplotlib 
> because my plots tend to be quite technical.
>
 
I also tried to use matplotlib but I think it is filereadable but my 
requirements are to add values from front end and then with one click graph 
will be ceated on these values.

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

2013-07-09 Thread John
On 09/07/13 15:40, amanjot kaur wrote:
>
>
>
> There are many python plotting libraries. I usually use matplotlib
> because my plots tend to be quite technical.
>
>  
> I also tried to use matplotlib but I think it is filereadable but my
> requirements are to add values from front end and then with one click
> graph will be ceated on these values.

...so you need to call matplotlib functions from the view function that
handles whatever form you have designed. If you want to plot onto an
image file (rather than embed canvas commands into an html response, for
example) then something like this might work:

def my_view_function(request):
1. Create a plot using matplotlib from the form parameters.
2. Save the plot in /path/to/static/plots/.png (depends where
you are serving static images from). I use uuid for things like this as
I know it will be unique and it doesn't have to be user friendly.
3. Prepare the html response which includes the graphic plot http://url/to/static/plots/.png">.
4. Return the html response.

If I was doing this, I would template the html part and also use the
settings variables for static file location/URL rather than hard-coding
the paths and URLs. I would also run some periodic background clean up
function to get rid of old plots otherwise they will steadily use more
disk space.

Hope that helps. Let the list know if it works!

John

-- 
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: Phonetic Algorithm in django??

2013-07-09 Thread Charly Román
2013/7/6 Harjot Mann :
> Can we use Phonetic algorithm in django for ignoring vowels while
> searching and for spell checking?

You can try with Fuzzy[0] or you can use a search engine like solr[1]
with haystack[2]


[0] - https://pypi.python.org/pypi/Fuzzy
[1] - http://lucene.apache.org/solr/
[3] - http://haystacksearch.org/

-- 
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: unit testing

2013-07-09 Thread ben
Also note that Django 1.6 will bring a better test discovery mechanism. See 
the full details at 
https://docs.djangoproject.com/en/dev/releases/1.6/#discovery-of-tests-in-any-test-module

Django 1.6 ships with a new test runner that allows more flexibility in the 
> location of tests. The previous runner (
> django.test.simple.DjangoTestSuiteRunner) found tests only in the 
> models.py and tests.py modules of a Python package 
> inINSTALLED_APPS
> .
> The new runner (django.test.runner.DiscoverRunner) uses the test 
> discovery features built into unittest2 (the version of unittestin the 
> Python 2.7+ standard library, and bundled with Django). With test 
> discovery, tests can be located in any module whose name matches the 
> pattern test*.py.

-- 
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: more testing questions

2013-07-09 Thread Dan Gentry
1) I've been using Factory Boy to create test data rather than fixtures. 
 It is so much easier to ensure that I know exactly what data is available 
for a given test.

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




Django Translation: Why is there no pgettext_noop or npgettext_noop?

2013-07-09 Thread Bob Barcklay
I want to use contextual markers and plural forms in strings with deferred 
translation.  I'm curious why _noop versions of pggettext and npgettext 
don't appear anywhere.  My plan is to modify the xgettext invocation found 
in django/core/management/commands/makemessages.py to include new 
--keywords for pgettext_noop and npgettext_noop.  Is this the correct 
approach?

-Bob



-- 
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: Django Translation: Why is there no pgettext_noop or npgettext_noop?

2013-07-09 Thread Ramiro Morales
On Tue, Jul 9, 2013 at 7:02 PM, Bob Barcklay  wrote:
> I want to use contextual markers and plural forms in strings with deferred
> translation.  I'm curious why _noop versions of pggettext and npgettext
> don't appear anywhere.

What do _noop-suffixed version(s) of gettext function(s) have to do with
contextual markers, plural forms and deferred translation?

Are you confusing _noop with _lazy?

> My plan is to modify the xgettext invocation found
> in django/core/management/commands/makemessages.py to include new --keywords
> for pgettext_noop and npgettext_noop.  Is this the correct approach?

-- 
Ramiro Morales
@ramiromorales

-- 
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: How to create a sessio in django

2013-07-09 Thread Mando
Hey Sivaram,

Here fav_color is just a a variable and you are putting the value of what 
is in request.session['fav_color'] into it

and request.session['fav_color'] is getting the key/value

so think of it this way 

request {
 'session' : { 'fav_color' : 'GREEN' }
}

you are putting GREEN in fav_color

does that make sense?


On Tuesday, July 9, 2013 1:41:29 AM UTC-5, Sivaram R wrote:
>
> I am learning django.
>
> I came accross the django doc about session.
>
> My question is for example if i am having the below models.py
>
> class Report(models.Model):
> user = models.ForeignKey(User, null=False)
> report_number = models.CharField('Incident Number', max_length=100)
> device_id = models.CharField('Device Id', max_length=100)
>
>  In doc,it is given that  fav_color = request.session['fav_color'],
>
> Here fav_color refers to what and ['fav_color'] refers to what.
>
> Need clarification
>

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