Re: [slightly offtopic] Which Python are people using on OSX?

2009-02-05 Thread Martin Conte Mac Donell
On Thu, Feb 5, 2009 at 7:07 PM, cjl wrote: > Honestly, I'm leaning towards option number 5. I'm just wondering what > other Django folks are using. I'm using MacPorts. It's the practical way. (x11? really?. Which version are you trying?) I'm using those ports: # port installed | grep py py25

Re: Making fields conditionally required based on another field's state

2009-02-02 Thread Martin Conte Mac Donell
On Mon, Feb 2, 2009 at 7:21 PM, wotaskd wrote: > > Hello everyone, a quick (and I guess easy) one: > > Is there any way, on the admin site, to make a field for a model > mandatory, if another one is blank and vice-versa? Yeap, you need to write your own form class, subclass clean() method do you

Re: how to check manytomany field in filter?

2009-02-02 Thread Martin Conte Mac Donell
On Tue, Feb 3, 2009 at 12:21 AM, garagefan wrote: > > Trying to test a manytomany field in a model that will be user names. > Building that is simple enough in the model, and so is selecting the > users in the admin. > > the problem is filtering a query to test the current logged in user > with t

Re: forms not valid

2009-02-02 Thread Martin Conte Mac Donell
On Mon, Feb 2, 2009 at 11:35 PM, vierda wrote: > > Hi all, I have three forms and none of these forms pass is_valid() > test when I test in intrepeter. kindly help for point out what's > problem with my forms. thank you. > > from django.contrib.auth.models import User > from django.contrib.auth.f

Re: Filter by ForeignKey reference??

2009-02-02 Thread Martin Conte Mac Donell
On Mon, Feb 2, 2009 at 11:59 PM, Martin Conte Mac Donell wrote: > If you need country_id/country_name: > >>>> Profile.objects.values('country__id', >>>> 'country__name').select_related('country').distinct() > [{'country__n

Re: Filter by ForeignKey reference??

2009-02-02 Thread Martin Conte Mac Donell
On Mon, Feb 2, 2009 at 10:11 PM, Markus T. wrote: > > Hi, > > I have two simple models: > > class Country(models.Model): > name = models.CharField(_("Name"), max_length=50, > unique=True) > > class Profile(models.Model): > name = models.CharField(_("Name"), max_length=50, > un

Re: Using hashing for password checking in auth module

2009-01-30 Thread Martin Conte Mac Donell
On Fri, Jan 30, 2009 at 5:36 PM, Guy Rutenberg wrote: > I've started using Django recently and when I've used the auth module > I noticed that it only verifies a plain text password. I'm not > comfortable with this behaviour as it means that passwords have to be > sent by login forms in plain tex

Re: Strange Model behavior

2009-01-25 Thread Martin Conte Mac Donell
On 1/26/09, Mark Jones wrote: > class Fails(models.Model): > code = models.CharField(max_length=64) > quizid = models.IntegerField(null=False, blank=False) > published_on = models.DateTimeField(auto_now_add=True) > > def __init__(self, *args, **kwargs): > super(Fails, sel

Re: TypeError: 'tuple' object is not callable

2009-01-23 Thread Martin Conte Mac Donell
On Fri, Jan 23, 2009 at 8:37 AM, joti chand wrote: > File "C:\Python25\Lib\site-packages\django\core\urlresolvers.py", > line 205, in _get_url_patterns >patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) > > File "C:\Python25\Lib\site-packages\django\core\urlresolve

Re: Possible Model Inheritance Issue? Error: [Model_Name] instance needs to have a primary key value before a many-to-many relationship can be used

2009-01-21 Thread Martin Conte Mac Donell
Again, i can't reproduce your problem. It's working using SVN HEAD with your model and this view: http://dpaste.com/111590/. Could you try to use that dict and Student(**mydict) instead of "model_import_info.model_for_import.objects.create" ? Regards, M On Wed, Jan 21, 2009 at 3:06 PM, Keyton W

Re: Possible Model Inheritance Issue? Error: [Model_Name] instance needs to have a primary key value before a many-to-many relationship can be used

2009-01-20 Thread Martin Conte Mac Donell
On Wed, Jan 21, 2009 at 2:35 AM, Keyton Weissinger wrote: > > Oh and just to re-state, this exact same code works like a champ on > import of School or Parent data (neither of which have a ManyToMany > field). > > Keyton I can't reproduce this exception. Try to print import_object_dict just befo

Re: Using forloop.counter0 on a variable

2007-12-17 Thread Martin Conte Mac Donell
now I'm not using the '|floatformat:2'. Is there anyway that > I can use that in my template with the new way: > > ${% get_element secondprice forloop.counter0 %} > > For an example...currently I'm getting back 124.1...I would like to > have it be 124.10 > >

Re: Problem trying to configure Django with FastCGI and Lighttpd

2007-12-17 Thread Martin Conte Mac Donell
Which version of django are you using? What do you see on lighttpd logs? Is port 3303 open with fcgi process? Regards, Martin Conte Mac Donell On Dec 17, 2007 4:23 PM, Chris Moffitt <[EMAIL PROTECTED]> wrote: > Take a look in the lighttpd server logs to see if there are any errors >

Re: Using forloop.counter0 on a variable

2007-12-17 Thread Martin Conte Mac Donell
You can do that with a very simple template tag register = template.Library() @register.simple_tag def get_element(list, index): # You should catch IndexError here. return list[index] Template side: {% get_element secondprice forloop.counter0 %} Regards, Martin Conte Mac Donell