groups and permissions data migrations?

2014-10-14 Thread Michael
Hi, Since the permissions are not yet created when the migrations are run, it is not possible to have a data migration that creates a group and assigns permissions. Based on this ticket: https://code.djangoproject.com/ticket/23422, I understand there will not be a fix. Do you recommend to keep

Using data migration to create initial users errors

2014-10-14 Thread BenW
I am trying to create initial users in Django 1.7 via a simple data migration like so: # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf import settings from django.contrib.auth import get_user_model from django.db import models, migrations def populate_initial_d

save as new in the Admin with 1:1 inlines causes IntegrityError

2014-10-14 Thread Mike Dewhirst
Using Django 1.6.7, in the Admin if I change the name of an object (in this case "substance") with 1:1 relationships and click [Save as new] I get an integrity error[1]. This was working in Django 1.5.x. Before I put in the effort to roll back to 1.5 for proof I thought I'd check the docs and

Re: django email client (reusable app) kickstarter

2014-10-14 Thread Internet Profil Filip Kowalski
You are right, we will provide support for all db backends. Extra functionality that is fully possible only with Postgres (e.g. use of GeoDjango) will require that backend. Core features mentioned in kickstarter description will work everywhere. Filip Kowalski Internet Profil www.internetprofi

Re: Unable to import 3 modules when running tests

2014-10-14 Thread Jason Ridenour
Are you running on Windows? I noticed you are using django-mssql. I'm having the same issue you are having - I'm using: django 1.7 Python 2.7 Windows 7 django-mssql 1.6 I'm thinking it's either an issue with the windows install of django or with django-mssql -- You received this message becaus

Re: django language tag

2014-10-14 Thread 6233114 6233114
Hello, There is no error. The translation simply reverts to the default language, which is English. On Wednesday, 15 October 2014 02:48:50 UTC+11, Collin Anderson wrote: > > Hello, > > What does the error say? > > Collin > > -- You received this message because you are subscribed to the Google

Re: An elegant and simple way to fire a signal after a Save is complete (completely complete :) )

2014-10-14 Thread Carl Meyer
On 10/14/2014 01:58 PM, Spiros Mouzakitis wrote: > What i finally did was to create a post_save signal as usual, and then > in my receiver function i execute the "specific code block" in a thread > (as mentioned > here: > http://stackoverflow.com/questions/11899088/is-django-post-save-signal-async

Re: An elegant and simple way to fire a signal after a Save is complete (completely complete :) )

2014-10-14 Thread Spiros Mouzakitis
Thanks Carls, What i finally did was to create a post_save signal as usual, and then in my receiver function i execute the "specific code block" in a thread (as mentioned here: http://stackoverflow.com/questions/11899088/is-django-post-save-signal-asynchronous) In the thread i also put a time

Appending trailing slashes to jQuery Ajax requests automatically

2014-10-14 Thread Ustun Ozgur
I have published a small snippet at https://github.com/ustun/ensure-trailing-slash-for-jquery-ajax/blob/master/ensure_slash.js that automatically adds a trailing slash to every outgoing AJAX request so as to minimize accidental redirects. Best, Ustun (Inspired by https://docs.djangoproj

Re: An elegant and simple way to fire a signal after a Save is complete (completely complete :) )

2014-10-14 Thread Carl Meyer
Hi Spiros, On 10/14/2014 10:05 AM, Spiros Mouzakitis wrote: > I have a model (model Employee) and i want to each time that it is > created / saved to run a specific code block. > My specific code requires that the model is already saved in the > database (i call an external API) > I can't use post

Run some code after Model Save completes (and after database is updated)

2014-10-14 Thread Spiros Mouzakitis
Hi, -I am looking for an elegant, and universal way to add some code AFTER the saving of a model and after of course the database is updated with changes. -I have tried post_save signals, but the transaction is still on, the entries do not exist in database -I have tried overriding save in model

An elegant and simple way to fire a signal after a Save is complete (completely complete :) )

2014-10-14 Thread Spiros Mouzakitis
Hi all, I have a model (model Employee) and i want to each time that it is created / saved to run a specific code block. My specific code requires that the model is already saved in the database (i call an external API) I can't use post_save signal , because the transaction is still pending (th

Re: centos 6 python 2.6 django 1.7 install problem

2014-10-14 Thread Berker Peksağ
On Tue, Oct 14, 2014 at 7:38 PM, Berker Peksağ wrote: > On Tue, Oct 14, 2014 at 7:33 PM, Sells, Fred > wrote: >> Downloaded the gz file, unzipped and ran python setup.py install > > Hi, > > Django 1.7 does not support Python 2.6. Please install Django 1.6 > instead. You can see the current suppor

Re: centos 6 python 2.6 django 1.7 install problem

2014-10-14 Thread Berker Peksağ
On Tue, Oct 14, 2014 at 7:33 PM, Sells, Fred wrote: > Downloaded the gz file, unzipped and ran python setup.py install Hi, Django 1.7 does not support Python 2.6. Please install Django 1.6 instead. You can see the current supported Python versions at https://docs.djangoproject.com/en/1.7/faq/ins

centos 6 python 2.6 django 1.7 install problem

2014-10-14 Thread Sells, Fred
Downloaded the gz file, unzipped and ran python setup.py install Note, due to network security settings, I cannot use pip or any similar tool that needs external web access I get the following errors, any advice on how to fix? …snip…. creating /usr/lib/python2.6/site-packages/Django-1.7-py

Re: How to "automatically " populate "last_updated_by" DB columns with the current user's id

2014-10-14 Thread Carl Meyer
On 10/14/2014 09:46 AM, Collin Anderson wrote: > If you _really_ want it to be automatic, I think your best bet is to use > a middleware to store the user or request object in a "thread local" > variable, and then have a pre_save signal set the last_updated_by field > based on that. That method is

Re: django language tag

2014-10-14 Thread Collin Anderson
Hello, What does the error say? Collin -- 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 e

Re: How to "automatically " populate "last_updated_by" DB columns with the current user's id

2014-10-14 Thread Collin Anderson
Hi Ken, If you _really_ want it to be automatic, I think your best bet is to use a middleware to store the user or request object in a "thread local" variable, and then have a pre_save signal set the last_updated_by field based on that. That method is frowned upon, but should work. (If you're

Re: What is the correct way to set a field value in the form_valid method of a CreateView?

2014-10-14 Thread Daniel Grace
I found the way to do this is with the "form.save" method, for example in the form_valid: state = get_state("test type", "test state") obj = form.save(commit=False) obj.state = state obj.save() -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: Question on url routing

2014-10-14 Thread robert brook
I have figured out how to determine if the url_conf was obtained from an internal link (which would be the only acceptable workflow) or through a url that the user typed into the address bar trying to subvert the workflow. See the attached screen shot of the view. If the view goes through the e

Re: Static Media Server (Tango with Django)

2014-10-14 Thread Max Nathaniel Ho
Hi Carl, Colin and Andréas, Thank you for all your replies. You have more than answered my question and clarified my doubts :) On Tuesday, October 14, 2014 1:11:37 AM UTC+8, Carl Meyer wrote: > > Hi Max, > > On 10/13/2014 01:39 AM, Max Nathaniel Ho wrote: > > Hi all, > > > > I am going throu

Re: Django: How to apply filter on geometry type using GeoDjango QuerySet

2014-10-14 Thread Shoaib Ijaz
Yeah, Now I am using .extra() function My Implementation On Tuesday, 14 October 2014 12:22:44 UTC+5, Jani Tiainen wrote: > > On Mon, 13 Oct 2014 23:34:04 -0700 (PD

Re: Django: How to apply filter on geometry type using GeoDjango QuerySet

2014-10-14 Thread Jani Tiainen
On Mon, 13 Oct 2014 23:34:04 -0700 (PDT) Shoaib Ijaz wrote: > > > I am trying to convert a SQL into Django Query: > > SELECT * from tbl_name where geometrytype(geometry) LIKE 'POINT'; > > I have searched on it but cannot find any geometry type function. > You can't, at least not with curren