Re: testing equality in template tag

2014-06-26 Thread Tom Evans
On Wed, Jun 25, 2014 at 7:34 PM, Lee Hinde wrote: > with view code like so: > > import calendar > months_choices = [] > for i in range(1,13): > months_choices.append((i, calendar.month_name[i])) > context['months'] = months_choices >

Re: Error: ImproperlyConfigured: The SECRET_KEY setting must not be empty

2014-06-24 Thread Tom Evans
On Tue, Jun 24, 2014 at 9:59 AM, Rini Michael wrote: > Hi, > i was trying to install django_cron using pip install django_cron,but > unfortunately > now i find a error as > ImproperlyConfigured: The SECRET_KEY setting must not be empty > can anybody help me with this >

Re: Static Analysis Tool

2014-06-24 Thread Tom Evans
There is also pyflakes. I've never met a static analysis tool that can correctly distinguish when something is wrong versus when something is misunderstood (by the tool). Therefore, whatever tool you use, you will have to spend some time telling it that certain things are false positives. Cheers

Re: Howto update a package in venv

2014-06-21 Thread Tom Evans
On Sat, Jun 21, 2014 at 4:57 PM, Michael Lind Hjulskov wrote: > Hi > > Im relative new to Django and Linux commands etc. > I hope to get help in here :o) > > I use virtualenv and requirements and one of the requirements is Sorl > But Sorl together with Django 1.6.5 is giving

Re: Django Post Issue

2014-06-20 Thread Tom Evans
On Fri, Jun 20, 2014 at 6:33 PM, G Z wrote: > I'm trying to post > customer_id > while generating a combo box with a loop from a database query. > I have the combo box generating and such, but the posted data does not > return the customer id. It returns something weird. > >>

Re: Upgrade Mysql

2014-06-20 Thread Tom Evans
On Fri, Jun 20, 2014 at 5:04 PM, Dariusz Mysior wrote: > But in mysite-mysite-settings.py in DATABASES I dont't have CONN_MAX_AGE and > in don't have in my general directory file my.cnf :/ Helpfully, mysql uses my.cnf to refer to a whole raft of different config

Re: Language code issue - Django thinks default is en-us?

2014-06-20 Thread Tom Evans
On Fri, Jun 20, 2014 at 1:47 PM, Vernon D. Cole wrote: > (*cough*) > Excuse me, everyone, but many of the locale names mentioned in this > discussion have been invalid. > > https://docs.djangoproject.com/en/1.6/topics/i18n/#term-locale-name says: >> >> locale nameA locale

Re: Django Dying upon loop

2014-06-20 Thread Tom Evans
On Fri, Jun 20, 2014 at 12:16 AM, G Z wrote: > my django server dies whenever i login and access the following function: > > what is a better way to do what im doing. I need to loop through all of the > vm_groups by customer id, and then loop through all of the vms and associate

Re: Language code issue - Django thinks default is en-us?

2014-06-19 Thread Tom Evans
On Thu, Jun 19, 2014 at 1:41 PM, Stodge wrote: > Yes I'm aware of this thanks. However, the documentation also states that I > can activate a different language in my custom command: > > If, for some reason, your custom management command needs to use a fixed > locale different

Re: Language code issue - Django thinks default is en-us?

2014-06-19 Thread Tom Evans
On Wed, Jun 18, 2014 at 7:10 PM, Stodge wrote: > By override I mean I add this at the start of my handle() function in my > custom management command: > > from django.utils import translation > translation.activate(settings.LANGUAGE_CODE) > > Where

Re: reset button

2014-06-18 Thread Tom Evans
On Wed, Jun 18, 2014 at 11:06 AM, Sebastián Richmond wrote: > Hi, > I am interested in a reset buttion for a form. > > I have this form.py > > > from django import forms > > class ContactForm(forms.Form): > topic = forms.ChoiceField(choices=TOPIC_CHOICES) >

Re: PostgreSQL, queries, speed

2014-06-17 Thread Tom Evans
On Tue, Jun 17, 2014 at 11:14 PM, Tom Evans <tevans...@googlemail.com> wrote: > You want a multi column index when you want to speed up queries > involving all the columns in that query. Or, depending on database features, queries involving all the columns[0:N] - eg an index on

Re: PostgreSQL, queries, speed

2014-06-17 Thread Tom Evans
On Tue, Jun 17, 2014 at 10:26 PM, Lachlan Musicman wrote: > tkc, > > Is that the default created when adding db_index=True of is that > something that I would do directly in postgres itself? > > cheers > L. Yep, although obviously that won't work when you want a multi-column

Re: How do I detect when a related object has been modified?

2014-06-12 Thread Tom Evans
On Thu, Jun 12, 2014 at 3:48 PM, Mezzy wrote: > Hello > > How do I detect when related models have changed; If I have models such as > the following: > > .. models.py > class Model1(models.Model): > > field = models.CharField(max_length=255, default="Some value") > > > class

Re: Why doesn't saving a related model update the _id field?

2014-06-10 Thread Tom Evans
On Tue, Jun 10, 2014 at 12:25 PM, Malcolm Box wrote: > On Monday, 9 June 2014 03:08:21 UTC+1, Russell Keith-Magee wrote: >> >> >> On Sun, Jun 8, 2014 at 10:34 PM, Malcolm Box wrote: >>> >>> I'm confused by Django's behaviour when saving related models.

Re: Displaying an uploaded file in a form

2014-06-05 Thread Tom Evans
On Thu, Jun 5, 2014 at 8:12 PM, Shawn H wrote: > I've been trying to understand how to handle file uploads, and I've got the > upload portion down. I have a FileField in my form, process it in my view, > and it's saved in the correct location as specified in MEDIA_ROOT

Re: Django app and a submodule name conflict

2014-06-05 Thread Tom Evans
On Wed, Jun 4, 2014 at 8:51 AM, Vahe Evoyan wrote: > I have modules in the project with the same names, all placed in different > applications. > > Particularly there are two apps that conflict and result an ImportError. The > project structure approximately is as follows.

Re: Django Macros Url. Routing must be simple!

2014-06-02 Thread Tom Evans
On Mon, Jun 2, 2014 at 7:49 PM, Alexandr Shurigin wrote: > Hi all! > > Yestarday i released beta version of new django routing helper component. > > Routing must be simple. Now we talking with django core team about making > django routing simpler by default. > > If

Re: The installation instructions for Windows is based on Python 3.4 But The MySQL connectors for Python are only for 2.7, 3.2 and 3.3

2014-05-21 Thread Tom Evans
On Wed, May 21, 2014 at 12:05 AM, Varuna Seneviratna wrote: > The installation instructions for Windows is based on Python 3.4 But The > MySQL connectors for Python are only for 2.7, 3.2 and 3.3 > What is the solution the problem? > PostgreSQL, sqlite or complain to

Re: Many links to one function in url.py

2014-05-21 Thread Tom Evans
On Wed, May 21, 2014 at 3:40 AM, Jun Tanaka wrote: > Hi there. > > > I hope to know the solution for the following: > say, there are several links to one function but I would like to identify > which link that come from. > > url.py looks > > (r'^link1/$',

Re: Is Django the best for my web app ?

2014-05-15 Thread Tom Evans
On Thu, May 15, 2014 at 10:33 AM, Amelie Bacle wrote: > Hello everyone, > > I have to do a web application at my work. I use to program with Python > every day but never for web application. So I wanted to know if Django is > the best choice for my problem. Here it is, in

Re: Model Objects and Updating db via XML

2014-05-14 Thread Tom Evans
On Tue, May 13, 2014 at 8:40 PM, Sayth Renshaw wrote: > Can I ask for some assistance please. > > For my project I will need to upate the database from an external xml file > consistently. The xml is like this one >

Re: Django case, when, then on querysets

2014-05-13 Thread Tom Evans
On Tue, May 13, 2014 at 11:04 PM, Anthony wrote: > Basically when a queryset like > instance.annotate(totals=Count('item_description')[:3] like > PC 10 > Mac 7 > Mouse 5 > Keyboard 4 > > I want to combine PC and Mac as say: Desktop so the results become > > Desktop 17 >

Re: Django case, when, then on querysets

2014-05-13 Thread Tom Evans
On Tue, May 13, 2014 at 1:00 AM, Anthony Hawkes wrote: > Hi Guys, > > I need to replace results in a queryset and then perform counts and further > queries on the set and have been trying to find a way of doing it. What do you mean by "replace results"? > > Basically in

Re: Opinion needed for a BookMarker project - Regarding CSRF token

2014-05-13 Thread Tom Evans
On Tue, May 13, 2014 at 6:44 PM, Aseem Bansal wrote: > Thanks for the explanation Tom. Really appreciate that. Your explanation is > very clear. My question's focus is not. From the beginning I have focused on > CSRF which might have taken the focus away from the real

Re: Opinion needed for a BookMarker project - Regarding CSRF token

2014-05-13 Thread Tom Evans
On Tue, May 13, 2014 at 6:14 PM, Aseem Bansal wrote: > I understand that it would leave the view open to CSRF attack. That is the > reason why I asked about "Also when you are doing Django projects and need > to deal with JS then what do you do? I mean is there an

Re: turn off csrf

2014-05-13 Thread Tom Evans
On Tue, May 13, 2014 at 4:36 PM, hinnack <henrik.gens...@miadi.net> wrote: > > Am Dienstag, 13. Mai 2014 16:48:57 UTC+2 schrieb Tom Evans: >> >> On Tue, May 13, 2014 at 2:49 PM, hinnack <henrik@miadi.net> wrote: >> > Hi, >> > >> &g

Re: turn off csrf

2014-05-13 Thread Tom Evans
On Tue, May 13, 2014 at 2:49 PM, hinnack wrote: > Hi, > > how can I turn off csrf completely - even in the admin interface? > > My base problem is, that with IE11 (and only IE11) I can not save any form > in the admin interface. I always get: > > CSRF verification

Re: How to localize database fields

2014-05-13 Thread Tom Evans
On Tue, May 13, 2014 at 1:23 PM, alghafli wrote: > Hello django users. I am new to django and a bit new to databases. This is > actually my first time making a web and database project. > What I want to do is to localize database field names so that the field name > appears

Re: Django Template Based If Statement Issue

2014-05-12 Thread Tom Evans
On Mon, May 12, 2014 at 10:47 PM, G Z wrote: > I'm just trying to associate each vm tied to the customers id and display > the vms under the customer that are associated with his id. > Normally, you would have some sort of relationship between those models, and the template

Re: Django Template Based If Statement Issue

2014-05-12 Thread Tom Evans
On Mon, May 12, 2014 at 10:02 PM, G Z wrote: > Views.py > > > from django.shortcuts import render > from django.http import HttpResponse > from vmware.models import Customer > from django.shortcuts import render_to_response > from vmware.models import Vms > > def index(request):

Re: Opinion needed for a BookMarker project - Regarding CSRF token

2014-05-12 Thread Tom Evans
On Mon, May 12, 2014 at 9:08 PM, Tom Evans <tevans...@googlemail.com> wrote: > On Mon, May 12, 2014 at 9:01 PM, Aseem Bansal <asmbans...@gmail.com> wrote: >> Hi Sanjay >> >> I think you misunderstood a bit. The JS that I am talking about will not be >> insi

Re: Opinion needed for a BookMarker project - Regarding CSRF token

2014-05-12 Thread Tom Evans
On Mon, May 12, 2014 at 9:01 PM, Aseem Bansal wrote: > Hi Sanjay > > I think you misunderstood a bit. The JS that I am talking about will not be > inside the web pages of the project. The JS is supposed to be used as a > Bookmarklet in the web browser. I intend to use the

Re: What does "+=" mean, or do?

2014-05-12 Thread Tom Evans
On Mon, May 12, 2014 at 2:22 PM, Malik Rumi wrote: > I saw it here > http://www.slideshare.net/jacobian/the-best-and-worst-of-django on slide 41. > That's a lot to go through, I know, sorry about that. But I googled it and > of course got nothing because Google ignores

Re: django on rhel5 with both python2.4 and python2.7 confusion

2014-05-12 Thread Tom Evans
On Mon, May 12, 2014 at 12:09 PM, David Malcolm wrote: > thanks for your reply WB. > > I was hoping to avoid virtualenv. My webapp is a frontend to a vulnerability > scanner in a large corporation. > They are very picky about what I can use and what I can't. Is virtualenv >

Re: How would you do this cleanly in Django (remembering the states of check boxes in multiple pages)

2014-05-10 Thread Tom Evans
On Thu, May 8, 2014 at 2:18 PM, Chi-Cheong Weng wrote: > Hi guys, > > I have been using Django for a little more than a year now, but I still > cannot think of a clean way of achieving this: > > Let's say I have 1000 products in the db and I want to create a campaign to >

Re: Django app called operator

2014-05-08 Thread Tom Evans
On Thu, May 8, 2014 at 11:48 AM, Domagoj Kovač wrote: > Hi everybody, > > I have a problem. In my settings i have: > >> INSTALLED_APPS = ( >> 'django.contrib.auth', >> 'django.contrib.contenttypes', >> 'django.contrib.sessions', >> 'django.contrib.sites', >>

Re: What is different of handling character code between pure Python and Django?

2014-05-08 Thread Tom Evans
On Thu, May 8, 2014 at 5:05 AM, Sugita Shinsuke <shinr...@gmail.com> wrote: > Hello Tom Evans > > >> plain single and double quotes - " and ', not “ and ‘. > My e-mail client is Gmail web client. > >>What version of Python? 2.x or 3.x? > Python versio

Re: Django URLS help app not defined

2014-05-07 Thread Tom Evans
On Tue, May 6, 2014 at 9:40 PM, G Z wrote: > Thanks so much one last thing >> > > Page not found (404)Request Method:GETRequest URL: > http://pythondev.enki.co:8001/customers > > Using the URLconf defined in provisioning.urls, Django tried these URL > patterns, in this order: >

Re: What is different of handling character code between pure Python and Django?

2014-05-07 Thread Tom Evans
On Sun, Apr 27, 2014 at 7:13 AM, Sugita Shinsuke wrote: > Hi there > > I’d like to run Java code via Django. > > The Java code, javaprogram use like below. > > — > java javaprogram [text] [file_name] > — > > text is parameter. multi-byte character is also okey. > file_name is

Re: Centos 6.5 Python 3.3.x Django 1.6 Apache 2.2

2014-05-02 Thread Tom Evans
On Fri, May 2, 2014 at 12:11 PM, Guillem Liarte wrote: > Hello, > > I have looked through the web in several different especialised forums but I > cannot find the way to do this properly. > > My aim is to have an environment to host Django applications running

Re: 'DJango' failed to install. Exit code: 1

2014-04-24 Thread Tom Evans
On Thu, Apr 24, 2014 at 4:03 PM, Kaloyan Marinov wrote: > http://answers.microsoft.com/en-us/windows/forum/windows8_1-winapps/django-failed-to-install-exit-code-1/e9324e01-9511-4222-93b1-f27eb535bba4 > > > Please help me with this one! > > Notebook CQ > > Intel x64 > >

Re: django output pdf problem

2014-04-24 Thread Tom Evans
On Thu, Apr 24, 2014 at 4:31 AM, 张永强 wrote: > > In my program, I want to generate a pdf and output to the browser. > > the server end code is: > > response = HttpResponse(content_type='application/pdf') > response['Content-Disposition'] = 'attachment; filename="' +

Re: Tutorial Part4: object_list() got an unexpected keyword argument 'object_id'

2014-04-22 Thread Tom Evans
On Tue, Apr 22, 2014 at 8:10 AM, Okabe Kenji wrote: > > At the end of tutorial part 4, I got following error message and could not > get displayed the result page. > Request Method: GET > Request URL: http://127.0.0.1:8000/polls/1/result/ > Django Version: 1.3.1 Django 1.3

Re: Upgrading from 1.4.3 to 1.4.10

2014-04-16 Thread Tom Evans
On Wed, Apr 16, 2014 at 3:08 PM, wrote: > How do I discover what changed between Django 1.4.3 and 1.4.10? > > Will require changes to my code, or will it just work? There should be no breaking changes for minor-minor* upgrades unless required to fix a security issue. I'm

Re: run manage.py commands within app

2014-03-25 Thread Tom Evans
On Sun, Mar 23, 2014 at 11:46 PM, judy wawira wrote: > Hello I have a django app using haystack and a solr backend to power > searches > > There is dynamic addition of data and wonder if there are other ways to > automatically rebuild the solr index without manually going to

Re: I am unable to get the choice field to validate on creating users. it doesn't make sense at all.

2014-03-20 Thread Tom Evans
On Thu, Mar 20, 2014 at 10:12 AM, sashank reddy wrote: > Hi Tom, > > I have not understood what you have said. Shouldn't choice_desig be called > every time I instantiate it in the view with the form = New_user_form(). I > thought I was creating an object of

Re: Middleware being called twice for every request, help?

2014-03-19 Thread Tom Evans
On Wed, Mar 19, 2014 at 5:50 PM, Nikolas Stevenson-Molnar wrote: > Are you making the request from a browser? If so, your browser is probably > making an extra request for the favicon. Two requests that just happened to generate the same random uuid, and skipped all other

Re: I am unable to get the choice field to validate on creating users. it doesn't make sense at all.

2014-03-19 Thread Tom Evans
On Wed, Mar 19, 2014 at 3:40 PM, sashank reddy wrote: > Hi, > > I have been trying to extend the UserCreationForm and have a form which > performs user registration and adds email and the names. > In addition I am using a choice field that allows a list down of

Re: Django not showing css - static files

2014-03-14 Thread Tom Evans
On Fri, Mar 14, 2014 at 6:08 PM, Lunga Baliwe wrote: > Good day Mike, > > I have STATIC_ROOT = os.path.join(BASE_DIR, 'website/static/') > website being the app name STATIC_ROOT has nothing to do with apps, it is where the files are copied to (by django) and served from (by

Re: problem with integrating bootstrap 3.1.1 and django 1.6

2014-03-14 Thread Tom Evans
On Fri, Mar 14, 2014 at 2:33 AM, Camilo Torres wrote: > python manage.py startapp testapp > > Inside the newly created test app directory, create static/css/ and put your > file there. Now try to reload your template to see if the template loads. > > This may make it work

Re: Trying to set up hashed versioning in Django for static files

2014-03-10 Thread Tom Evans
On Mon, Mar 10, 2014 at 1:02 AM, Vernon Burt wrote: > I suppose that's my confusion - before this, each application directory had > it's own /static/ directory with /css/, /js/ and /img/ directories as > needed. I adjusted the settings as mentioned and tried the following:

Re: Trying to set up hashed versioning in Django for static files

2014-03-08 Thread Tom Evans
On Fri, Mar 7, 2014 at 4:08 AM, Vernon Burt wrote: > Hello all, > > I've pretty quikly found out in my DJango adventure that I need to have some > kind of versioning for my static css and javascript files. After talking to > some web developers I was directed to use Django's

Re: Cannot get mp4 to play in IOS

2014-03-07 Thread Tom Evans
On Fri, Mar 7, 2014 at 10:02 PM, Jason Kirby wrote: > Hi all, > > I have a site that allows users the ability to watch an mp4 video on my > Django site. It can be played anywhere except on iOS devices. I'm pretty > sure it has something to do with Django because when I play

Re: RAW query to non default DB

2014-03-07 Thread Tom Evans
On Fri, Mar 7, 2014 at 3:31 PM, bikeridercz wrote: > Dear colleagues, > > I'm trying to do a direct select do database other than the default one. But > it fails with error. > > Note 1: "ASSETS.objects.using('vodb').filter(...)" works fine > Note 2: the select is little tricky and

Re: Class that extends a model that is not a model

2014-03-05 Thread Tom Evans
On Wed, Mar 5, 2014 at 1:03 PM, Domagoj Kovač wrote: > Hi Guys, > > I have a model called Calculation, this model has fields that are calculated > and saved to the database, this model also hold some common calculation > functions. > > I also have two other classes

Re: Why doesn't a forms.fields.DateField always return a datetime.date instance?

2014-03-04 Thread Tom Evans
On Tue, Mar 4, 2014 at 10:45 PM, Peter Bengtsson wrote: > The link was to django master. So it's in all versions. > Well, that doesn't necessarily follow does it? It could have been changed recently in trunk, say for 1.6 release. If you were using 1.5 it could be different. I

Re: confused about sql in django

2014-03-04 Thread Tom Evans
On Tue, Mar 4, 2014 at 8:08 PM, Robin Lery wrote: > Hello, > > I am really being confused. How to use sql in django? I found two: > 1. Performing raw queries. > 2.Executing custom SQL directly. > > Does it have better performance than the django's orm? And how is the >

Re: Why doesn't a forms.fields.DateField always return a datetime.date instance?

2014-03-04 Thread Tom Evans
On Tue, Mar 4, 2014 at 8:27 PM, Peter Bengtsson wrote: > I've been googling for an explanation but nothing's come up. > > See > https://github.com/django/django/blob/master/django/forms/fields.py#L447 > > If you use a `DateField` in your form, don't you expect it to produce a >

Re: Why doesn't a forms.fields.DateField always return a datetime.date instance?

2014-03-04 Thread Tom Evans
On Tue, Mar 4, 2014 at 8:27 PM, Peter Bengtsson wrote: > I've been googling for an explanation but nothing's come up. > > See > https://github.com/django/django/blob/master/django/forms/fields.py#L447 > > If you use a `DateField` in your form, don't you expect it to produce a >

Re: Trouble with Django in production server.

2014-03-04 Thread Tom Evans
On Tue, Mar 4, 2014 at 7:11 PM, Daniel Roseman wrote: > That's why, as everyone keeps telling you, you need > to activate the virtualenv in your server, which is normally done in the > wsgi file. Is it? I keep my wsgi.py exactly as startproject created it, I set

Re: erreur django.core.management

2014-02-27 Thread Tom Evans
On Thu, Feb 27, 2014 at 1:10 PM, Grimaud Florent wrote: > bonjour, > quand j'installe updatengine j'ai un problème avec Django > > "file /var/www/UE-environment/updatengine-server/manage.py", line 8, in > module > from Django.core.management importe exécute

Re: Terrible performance when dropping into raw SQL Oracle

2014-02-26 Thread Tom Evans
On Wed, Feb 26, 2014 at 6:16 PM, Shawn H wrote: > Yes. I've tested with several case numbers, and I'm using a similar > parameterized approach in my gui Oracle client as well, with the same > results. It's always about 3 to 4 times slower running via django. I've >

Re: Accessing a python function from a blog post stored in the db?

2014-02-26 Thread Tom Evans
On Wed, Feb 26, 2014 at 5:29 AM, Dennis Marwood wrote: > Thanks. I believe this is what I am looking for. However I am still running > into an issue w/ the fact that I am pulling my blog entries from the db. > This is causing the template to interpret the {% image_slider

Re: How pass authentication using django_auth_ldap ?

2014-02-25 Thread Tom Evans
On Tue, Feb 25, 2014 at 2:31 PM, Fabio Surrage wrote: > Greetings ! > > Im trying to code a Automated Deploy System to Applications using Zope/Plone > and JBOSS/Java and I am having some issues with LDAP Authentication. > > The authorization is OK, my problem is to make

Re: How to host multiple instances of the same app with Windows Apache & WSGI?

2014-02-25 Thread Tom Evans
On Tue, Feb 25, 2014 at 12:02 PM, DJ-Tom wrote: > Hi, > > currently I'm using the following configuration to host a Django > appliaction: > >> # WSGI Configuration >> >> WSGIScriptAlias /2013/spcmanage "D:/dev/spcmanage/spcmanage/wsgi.py" >> WSGIPythonPath

Re: Integrate with an ADFS Server for Login

2014-02-25 Thread Tom Evans
On Tue, Feb 25, 2014 at 10:44 AM, Me Sulphur wrote: > Hi, > > For one of our new deployments we need to replace our authentication > (django's default) with the client's Single Sign On (SSO). The client uses > ADFS 2.0 for SSO. > None of us have ever worked on .NET/Windows

Re: big legacy database with complex many to many relationships

2014-02-24 Thread Tom Evans
On Mon, Feb 24, 2014 at 7:54 PM, Sells, Fred wrote: > I have to integrate to a large read only legacy mssql database . > > > > The many-to-many tables have a lot of additional fields like start/end dates > of the relationship and their own naming conventions > > > >

Re: Django test client encoding of JSON Booleans

2014-02-24 Thread Tom Evans
On Mon, Feb 24, 2014 at 7:37 PM, Daniel Smith wrote: > Thank you very much for the help. So it sounds like I just have to suck it > up and call json.loads() on request.body. > > The 'format=json' thing is related to also using the TastyPie test client. > I've tried

Re: Can't figure out how to attach file to email using EmailMessage

2014-02-21 Thread Tom Evans
On Fri, Feb 21, 2014 at 4:28 PM, Patrick Beeson wrote: > Good morning y'all! > > I'm having a heck of a time figuring out what I'm doing wrong in attaching a > file uploaded via a ModelForm to an email that's sent if the form is valid. > Here's a link to my code on

Re: "Beginning Geo Django: Rich Gis Web Applications With Python" Where can I get the book?

2014-02-21 Thread Tom Evans
On Fri, Feb 21, 2014 at 10:15 AM, Ram Shrestha wrote: > Dear All, > I am want to learn GeoDjango in real world application. I believe this book > "Beginning Geo Django: Rich Gis Web Applications With Python" is the best > book for me. But I could not download download it.

Re: Digging Up Django Class-based Views

2014-02-18 Thread Tom Evans
On Tue, Feb 18, 2014 at 11:03 AM, wrote: > Seems great ! I am looking forward reading it. > > I have a question about class-based views (hope it's clear enough) : > I wanted to know when the views are instanciated and when there are garbage > collected In Django. The

Re: caching django querysets, debug toolbar shows queries still running on page load

2014-02-17 Thread Tom Evans
On Sun, Feb 16, 2014 at 6:56 AM, Levi McDonough wrote: > > Hey everyone, I'm having problems with caching a queryset and storing the > results of the query in the cache so the queries don't run when the page > loads. I am caching and pickling the queryset, however I keep

Re: Django TodayArchiveView showing the date for next day

2014-02-17 Thread Tom Evans
On Sat, Feb 15, 2014 at 5:29 PM, wrote: > I just followed instructions on django website > https://docs.djangoproject.com/en/dev/ref/class-based-views/generic-date-based/ > DayArchiveView was working and TodayArchiveView was showing the date for the > next day. Set your

Re: is this (online tutorial) code calling a view from a view?

2014-02-17 Thread Tom Evans
On Sat, Feb 15, 2014 at 2:47 PM, Andrew Taylor wrote: > Hi, > > I've been following an online tutorial but been debugging. I've traced my > issue to this line in the view function below: > > return category(request, category_name_url) > > > Is this view effectively calling

Re: List of default Django tags that are "mid-block" like else

2014-02-14 Thread Tom Evans
On Fri, Feb 14, 2014 at 1:08 PM, Ram Rachum wrote: > Thanks! > > But empty and the various forloop don't concern me because they're {{ }} > rather than {% %}, they don't start a block. > > Anything else? > If you are truly interested, look at the source for

Re: FieldError, But Only In Production

2014-02-14 Thread Tom Evans
On Fri, Feb 14, 2014 at 12:38 AM, Javier Guerra Giraldez wrote: > On Thu, Feb 13, 2014 at 7:09 PM, Rich Jones wrote: >> We're good now. No idea what the hell was happening, but this works now. >> Humbling to realize how little I know about the ORM

Re: FieldError, But Only In Production

2014-02-13 Thread Tom Evans
On Thu, Feb 13, 2014 at 6:00 AM, Rich Jones wrote: > Hey guys! > > I've got a real stumper here. Pulling my hair out over this one, would > really appreciate some options! > > Anywhere in my application that calls user.get_profile() causes a > FieldError.. but only in

Re: Checkboxes collection instead of a multiple select

2014-02-12 Thread Tom Evans
On Wed, Feb 12, 2014 at 11:56 AM, Jonathan Querubina wrote: > Tom, > > Thanks for the feedback! > > This can be used on the admin form? > Absolutely, simply override the widget for that specific field when you register your ModelAdmin for that model:

Re: [JOB] $1,500 referral reward - Know anyone for Lead Python / Django Developer opening?

2014-02-12 Thread Tom Evans
On Tue, Feb 11, 2014 at 10:19 PM, Cal Leeming [Simplicity Media Ltd] wrote: > Hi Marsh, > > Could you have a read of this thread; > https://groups.google.com/forum/#!msg/django-users/q64B4chm1ho/cCp_Xvxu41oJ > > It has some tips/advice on what to put into a

Re: hidden field value inside if block

2014-02-10 Thread Tom Evans
On Mon, Feb 10, 2014 at 2:35 PM, Ionut Oprescu wrote: > is there a way to verify a hidden field value inside a if statement? > > for example: > > > {% if details.id_details == hdnIdDetalii.value %} > code here > {% endif %} > > something like this... > > note! i`m using

Re: Checkboxes collection instead of a multiple select

2014-02-06 Thread Tom Evans
On Thu, Feb 6, 2014 at 11:15 AM, Jonathan Querubina wrote: > Hi guys, > > How do i show a collection of checkboxes instead of a multiple select? > > Thanks! Sounds like you want to change the widget on a form: https://docs.djangoproject.com/en/1.6/ref/forms/widgets/

Re: Model field's verbose_name from database?

2014-02-05 Thread Tom Evans
On Wed, Feb 5, 2014 at 5:47 PM, Jon Dufresne wrote: >> Why not use dictionary to Map user-level names to database-fields > > I'm not sure I fully follow what you're suggesting. But it sounds like > you're suggesting I move the configuration of field name out of the >

Re: Django response with two HTTP 'WWW-Authenticate' headers

2014-01-20 Thread Tom Evans
On Mon, Jan 20, 2014 at 7:51 AM, Alexey Gusev wrote: > Im developing small intranet web service. I want authenticate users over > kerberos in MS AD or with basic auth. For that reason i need to set two > 'WWW-Authenticate' http headers in response 401. How can i do it

Re: Django Admin - Duplicating and Filtering Many to Many fields in form

2014-01-17 Thread Tom Evans
On Fri, Jan 17, 2014 at 12:38 PM, Ara Sivaneswaran wrote: > Hey guys, > > > I am kind of stuck... > > This is the situation. I got a Match Model, a Player Model and a Team model. > > > Here is what models look like so far: > > > Match Model (simplified version) > >

Re: Fast and Easy way to check if an instance of an Model exists in the Database

2014-01-17 Thread Tom Evans
On Thu, Jan 16, 2014 at 5:23 PM, Johannes Schneider wrote: > This could be a way to it, but we need this information while handling the > Pre_save singal. So this does not work too. Abuse the django model instance's internals and look to see what database

Re: Problem with Form with ForeignKey field

2014-01-16 Thread Tom Evans
On Wed, Jan 15, 2014 at 8:44 PM, Jonathan Pentecost wrote: > Does it have anything to do with the related name of animal being `+`? I > can't test this out just yet, but I don't THINK you can have a related_name > as just `+`, I believe it needs to be a valid

Re: Encoding UTF 8 (añ,etc) and datetime function

2014-01-15 Thread Tom Evans
On Tue, Jan 14, 2014 at 6:12 PM, David Pineda wrote: > > The code: > > from django.http import Http404, HttpResponse > import datetime > # coding: utf-8 > > def hello(request): > return HttpResponse("Hello world") > def home_page(request): > return HttpResponse("Página

Re: DecimalField Problem

2014-01-14 Thread Tom Evans
On Tue, Jan 14, 2014 at 7:23 AM, Eric Rouleau wrote: > The problem seems to be in the postgres backend or Psycopg 2.5.2 adapter... > I have the same problem and the data in postgres is 0. but when > fetched by django it comes up as Decimal("0E-8") (with shell access not

Re: DateTimeQuery object has no attribute tzinfo when USE_TZ is True

2014-01-13 Thread Tom Evans
On Sat, Jan 11, 2014 at 4:51 AM, Kush Goyal wrote: > I am using postgres as my database. I have a model called Invoice with a > datetime field. I get an error when I run the query: > > Invoice.objects.datetimes('date_field','day') > > The error is: > > AttributeError:

Re: question about url

2014-01-09 Thread Tom Evans
On Thu, Jan 9, 2014 at 11:06 AM, luca72 wrote: > Hello > i have defined an url as: > > (r'^tipi/(\w)', 'polls.views.tipi'), The word 'tipi', followed by a forward slash, followed by a SINGLE 'word' character, and then any other characters before the end of the URL (but none

Re: Which Real Time Communications Protocol

2014-01-08 Thread Tom Evans
On Mon, Dec 30, 2013 at 7:14 PM, Nikolas Stevenson-Molnar wrote: > The reason for this (someone please correct me if I'm wrong on this) is that > Django isn't meant to hold connections indefinitely. Ideally you want to get > a request and turn around a response as quick as

Re: track on click

2013-12-20 Thread Tom Evans
On Fri, Dec 20, 2013 at 9:44 AM, praveen pal wrote: > Dear All > > how can we keep track on click in Django? > suppose i have a MOOC (massive open online course ) site in which user > register for a course and > watch videos , attempt quiz and give answer of question

Re: fire and "forget" in a view

2013-12-20 Thread Tom Evans
On Fri, Dec 20, 2013 at 11:11 AM, Christian Schulz wrote: > Hi, > > in my views i have method calls which might be take some time. It is > sufficient to return a simple message and request > the result in another step. > > I explore celery , but It might be to complex ,

Re: How to automatically test Django apps

2013-12-17 Thread Tom Evans
On Tue, Dec 17, 2013 at 3:00 PM, bobhaugen wrote: > That's interesting, but how about making it free for open-source apps who > give you a credit on their repos? Why not just use selenium, then you can use it to test both your open source sites and ones that you write for a

Re: How to urlquote backslash in reverse arguments

2013-12-17 Thread Tom Evans
On Tue, Dec 17, 2013 at 10:15 AM, Vitaly wrote: > Hi > > I got an some incorrection in reverse behaviour. > > From django docs > > The string returned by reverse() is already urlquoted. For example: > reverse('cities', args=[u'Orléans']) > '.../Orl%C3%A9ans/' > Applying

Re: ModelForms

2013-12-11 Thread Tom Evans
On Wed, Dec 11, 2013 at 11:22 AM, wrote: > > Hello, > > when using ModelForms, which is the correct way to implement the "edit item" > pattern? > > Suppose I've a table with many rows, each representing a record in a > database. > I choose one and wish to

Re: Writing your first Django app, part 1 (1.6)

2013-12-11 Thread Tom Evans
On Tue, Dec 10, 2013 at 10:19 PM, Suhendri wrote: > Hi, > > I'm new in Django, I'm excited with Django so I have to following the > existing tutorial to knew how to create a program with Django. > > I started with tutorial 1, Writing your first Django app, part1. I

Re: Best way to learn Django considering Python versions and etc.

2013-12-10 Thread Tom Evans
On Tue, Dec 10, 2013 at 4:57 PM, Bruce Whealton wrote: > Hello all, > So, I started looking at recommended reading on Django and a > couple books referred me to first go through "The Definitive Guide To > Django." I have to admit some concern about reading a

Re: How is /admin/jsi18n/ created

2013-12-09 Thread Tom Evans
On Thu, Dec 5, 2013 at 4:05 PM, Vincent Hussey wrote: > Hi, > We are looking at date formats for django and we are trying to figure out > how django creates the localised formats found at the link below. > > After a bit of investigation we have found out how to set them using

<    1   2   3   4   5   6   7   8   9   10   >