How to customize ModelChoiceField?

2010-05-29 Thread shaunc
I have a table of Rates: class Rate( models.Model ): edition = ForeignKey( Edition ) description = ForeignKey( Foo ) rate = IntegerField( ) ... [ other fields not relevant here ] and a RateForm: class RateForm( forms.ModelForm ): class Meta: fields = ( 'description',

Re: delete file or image after deleting model item

2010-05-29 Thread Shawn Milochik
You can override the delete function of your model to take care of this. Alternatively, if you want to do this for a bunch of different models, it might be cleaner to use signals. Shawn -- You received this message because you are subscribed to the Google Groups "Django users" group. To post

Re: What would be the best way to implement a login audit?

2010-05-29 Thread Shawn Milochik
It would be nice if contrib.auth threw signals for auth attempts. I don't think a custom auth backend would be the best solution, because a custom auth backend as described in the documentation doesn't receive the request object, which is where the stuff you want (such as IP address) can be

Re: Can't access Django Dev Server.

2010-05-29 Thread Juan Hernandez
any firewall?? On Sat, May 29, 2010 at 8:03 PM, gin tonic wrote: > My development server is running but when I attempt to access it at > the localhost 127.0.0.1:8000 I receive a page not found error while my > command shell shows no attempt to access the site. > > No

Can't access Django Dev Server.

2010-05-29 Thread gin tonic
My development server is running but when I attempt to access it at the localhost 127.0.0.1:8000 I receive a page not found error while my command shell shows no attempt to access the site. No error messages. No sign of a connection attempt. Anyone ever seen this before? Thanks. -- You

What would be the best way to implement a login audit?

2010-05-29 Thread Vasil Vangelovski
I'm developing an intranet application where one of the requested features is having a detailed log containing entries of IP, user and timestamp every time someone has logged in successfully. Also as a bonus feature I'd like to implement a log of failed login attempts. What would be the cleanest

Re: passing variable values in javascript being served statically

2010-05-29 Thread gvkalra
Hi. here is the code: http://pastebin.com/HtNq52aV what i am trying to do:: get the visitor location from his IP address in {{latitude}} and {{longitude}} . get my business location in {{BUSINESS_LOCATION}} . then trace a route from visitor location to my business location. On May 25,

need help writing FactorySquirrel - a custom fixture handler

2010-05-29 Thread Phlip
Django-users: Our tests take too long to run, so I'm spending the weekend sketching an alternate fixture system, based on RoR's "factory girl". The fixtures inject model objects directly into the current namespace, but this test fails: class UseFactorySquirrelTests(TestCase,

Re: how to show blank spaces at the start of string in django templates

2010-05-29 Thread Daniel Roseman
On May 29, 2:47 pm, Ogi Vranesic wrote: > Hi > > I formated with python numbers like e.g.: > > "   3457.50" > " 11450.25" > > but my problem is to show them correctly one below the other > in a column by django templates > because the blank spaces are ignored. > I tried with the

Re: Thread safety with Form Wizard

2010-05-29 Thread Wiiboy
Anyone? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this

Re: Having to rstrip the " [] " from the end of your Key when posted?

2010-05-29 Thread pyfreak
Yep, it applies then, becuase I am using jQuery 1.4 and I'm using $.post to send the stuff to the server, with a "json" paramater at the end. Thanks for the link James On May 29, 5:26 am, Euan Goddard wrote: > Yeah jQuery added this annoying "feature" in 1.4. >

ImportError: No module named django.core

2010-05-29 Thread illuminated
Hi all, I guess this is a PATH/PYTHONPATH error, but my attempts failed so far to make django working. System is Ubuntu 10.04, 64bit. Python version: 2.6.5: @mx:~/webapps$ python -V Python 2.6.5 When I run django-admin.py, the following happens: mx:~/webapps$ django-admin.py Traceback (most

Re: How to use CommaSeperatedIntegerList with CheckboxSelectMultiple

2010-05-29 Thread Jannon Frank
Don't know if you're still interested, Ben, But I just came across this as I was searching for the best place to tell someone how the django CommaSeparatedIntegerField(CSIF) should be changed. I was basically trying to do the same thing you were. After, taking a look at the django code, I found

how to show blank spaces at the start of string in django templates

2010-05-29 Thread Ogi Vranesic
Hi I formated with python numbers like e.g.: " 3457.50" " 11450.25" but my problem is to show them correctly one below the other in a column by django templates because the blank spaces are ignored. I tried with the filter escape, however it does not work. A solution would be to loop over

Re: django-registration custom fields

2010-05-29 Thread shacker
See also: http://birdhouse.org/blog/2009/06/27/django-profiles/ ./s -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to

Re: django-registration custom fields

2010-05-29 Thread Praveen
Hi Pankaj here you may refer my blog where i explain how you may extend some fields while registration. http://praveensunsetpoint.wordpress.com/category/django/django-registration-profile/ Praveen On May 29, 4:41 pm, Pankaj Singh wrote: > I tried extending

Re: Get pk before commit

2010-05-29 Thread Praveen
Did you really mean for commit=FALSE or pre_save signal??? Praveen On May 29, 5:22 pm, Euan Goddard wrote: > Hi, > > Could you explain the situation in a little more detail as I don't > quite follow what you mean. As far as I'm aware if you have something > like

Re: VariableDoesNotExist when I go to login page

2010-05-29 Thread Praveen
Error describes well. your request key is not exist while rendering. are you rendering your 'request' variable to page. and what is the request here. Thanks Praveen On May 29, 5:37 pm, Victor Fontes wrote: > I get an error in this line: > > class="first">Inicio > > Everyting

VariableDoesNotExist when I go to login page

2010-05-29 Thread Victor Fontes
I get an error in this line: Inicio Everyting was working just fine and all of a sudden I started to get this error: http://dpaste.com/200702/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Having to rstrip the " [] " from the end of your Key when posted?

2010-05-29 Thread Euan Goddard
Yeah jQuery added this annoying "feature" in 1.4. There's no "nice" way around it other than to recognise that any JS arrays will have this suffix. Euan On 29 May, 05:33, pyfreak wrote: > I accept this as normal now. I think, what I'll need to do if I'm > against

Re: Get pk before commit

2010-05-29 Thread Euan Goddard
Hi, Could you explain the situation in a little more detail as I don't quite follow what you mean. As far as I'm aware if you have something like the following: >>> my_inst = MyModel(foo="bar", ...) >>> my_inst.save() You'll have the pk at this point even if the transaction hasn't been

Re: django-registration custom fields

2010-05-29 Thread Pankaj Singh
I tried extending RegistrationFormUniqueEmail class CustomRegistrationFormUniqueEmail(RegistrationFormUniqueEmail): first_name = forms.CharField(label=_('First name'), max_length=30,required=True) last_name = forms.CharField(label=_('Last name'), max_length=30, required=True) def

django-registration custom fields

2010-05-29 Thread Pankaj Singh
Hi I want to extend django-registration form by adding fields like first name last name date of birth country languages you speak etc. for my project .. how should i proceed for this .. -- -- -- Thanking You, Pankaj Kumar Singh, 2nd Year Undergraduate Student, Department of Agricultural and

Re: Looking for a good CRUD example

2010-05-29 Thread Lee Hinde
Thanks. It does look helpful. On Fri, May 28, 2010 at 3:48 AM, Richard Shebora wrote: > Try... > > http://alpha.djangogenerator.com > > It will generate a substantial amount of boilerplate code for you. > Including templates and various views for listing, editing and viewing

Get pk before commit

2010-05-29 Thread TheIvIaxx
Hello, I am trying to figure out how to get a pk in the middle of a transaction. I need to set a field in the model based on the ID(default pk) to be given. As far as a i know, this ID should be allocated during the transaction. So i would imagine it would do the INSERT, then i could get the pk

Using Google Fusion tables as database

2010-05-29 Thread Gregor
Hi, Is it possible to use Django with Google Fusion Tables http://code.google.com/apis/fusiontables/ as the backend? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To