virtualenv used with mod_wsgi

2010-09-14 Thread Jagdeep Singh Malhi
I am try to use Multiple version of Django on same machine. I am using the Virtual Python Environment builder (virtualenv 1.5). I am able to install this using documentation. http://pypi.python.org/pypi/virtualenv#downloads but now i am facing problem with mod-wsgi. i am not able to understand

Re: Prepopulating fields from parent, or related models, in the admin

2010-09-14 Thread pixelcowboy
Im not sure Im getting this properly. In the example above, how would you know what the word "whatever", the query value, stands for? How could you keep it dynamic in that the values of that field is taken from whatever the actual parent object is? Thanks. On Sep 14, 2:34 pm, pixelcowboy

Re: Tools to ease template/ui development

2010-09-14 Thread Brandon Taylor
I use Aptana with PyDev and get code completion for Python, HTML, CSS, JavaScript (and jQuery) and more. It's cross-platform, free and the Beta 3 version has even more Django support thanks to the latest version of PyDev. There are plugins for Git, Mercurial, SVN and more. Brandon On Sep 14,

Need to access fieldsets for custom model admin from ModelForm

2010-09-14 Thread Brandon Taylor
Hi everyone, I need to add a checkbox field to an ModelForm, which is easy enough by overriding __init__ on the ModelForm, but I'm also using a custom fieldset on the ModelAdmin. So, I need to be able to add the field to the fieldset from the form's __init__ Possible? I'm not sure how I can get

Re: Overriding queryset for admin.ModelAdmin

2010-09-14 Thread Brandon Taylor
The solution is to add the foreign key field as a list_filter, then Django will accept the querystring parameter. Hope that helps someone! On Sep 13, 7:29 pm, Brandon Taylor wrote: > Hi everyone, > > I have a very strange problem I'm trying to get a handle on. I need to

Re: contrib.comments, admin section [unable to see comments]

2010-09-14 Thread Nick
Thank you Karen, I never would have thought to look for something like this. Here's the situation though, there was invalid data however it's related to contrib.comments due to how contrib.comments is structured. My comments were displaying perfectly fine in the threads they belonged to (not in

Re: contrib.comments, admin section [unable to see comments]

2010-09-14 Thread Karen Tracey
On Tue, Sep 14, 2010 at 12:52 PM, Nick < iregisteratwebsiteswitht...@gmail.com> wrote: > Hello, > > I tried to troubleshoot this with Google and #django on IRC but I'm > coming up empty. I've been following the practical django projects > second edition book using django 1.2.3 on a local server.

haystack problem - already registered error

2010-09-14 Thread Kenneth Gonsalves
hi, I have installed haystack with xapian backend. My relevant code is like this: import haystack haystack.autodiscover() from haystack.indexes import * from haystack import site from web.models import Stock class StockIndex(RealTimeSearchIndex): text = CharField(document=True,

Re: can't get m2m_changed signal working

2010-09-14 Thread Jason
Not sure it'll help but I've always used the 'sender' kwarg (I've used it a total of once to be fair): for example: m2m_changed.connect(update_answer_set_num_answers, sender=AnswerSet.answers.through) On Sep 14, 11:43 am, allyb wrote: > hi, > > yes, it is called in

Re: Tools to ease template/ui development

2010-09-14 Thread Javier Guerra Giraldez
On Tue, Sep 14, 2010 at 4:18 PM, pixelcowboy wrote: > I would really love something like pyjamas but that works with jquery > or something like that. What I would really love is to forget every > other programming language and just use python everywhere. Wouldn't > that

Querying Exact Foreign Key Sets

2010-09-14 Thread Jason
Say for example you have two models: Article Category Articles can have multiple categories. How would you go about finding the Articles that contain only a certain set of Categories? The 'in' operator doesn't do me any good. Excludes look like they are needed... I'm in a situation where

Re: Prepopulating fields from parent, or related models, in the admin

2010-09-14 Thread pixelcowboy
I'll try when I get home, but thanks again for your help! On Sep 14, 11:31 am, "nick.l...@gmail.com" wrote: > Hi again! :) > > I haven't thought this idea through, and very well could be > wildly inefficient! :) > > Though in your admin.py when registering the admin model do

error after upgrading to 1.2.3

2010-09-14 Thread Börni
Hello together, after upgrading to django 1.2.3 i got the following error: /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/ python2.6/site-packages/MySQLdb/__init__.py:34: DeprecationWarning: the sets module is deprecated from sets import ImmutableSet Traceback (most recent call

Re: Tools to ease template/ui development

2010-09-14 Thread pixelcowboy
I would really love something like pyjamas but that works with jquery or something like that. What I would really love is to forget every other programming language and just use python everywhere. Wouldn't that be sweet? On Sep 14, 1:20 pm, bruno desthuilliers

Re: View to serve dumpdata output

2010-09-14 Thread nick.l...@gmail.com
one way to do it would be to do this (on an app by app basis) http://docs.djangoproject.com/en/dev/topics/serialization/#serializing-data Then have your view return data n On Tue, Sep 14, 2010 at 8:01 PM, David Somers Harris < da...@somers-harris.com> wrote: > Is it possible to write a view

getting force_update to work

2010-09-14 Thread Anomal
According to the Django docs, a new row is created with the new value primary key when when I change the value of a primary key and save the object. In this case, I am looking to change the value. So, I use force_update=True. Instead of changing the value of the primary key, I get a

Re: Tools to ease template/ui development

2010-09-14 Thread bruno desthuilliers
On 14 sep, 20:23, payala wrote: > I agree about Aptana. I am trying it right now and it looks very good, > I already used eclipse and I think it rocks! Emacs is the OneTrueEditor !-) > However, re-reading my post I realise that I didn't express myself as > well as I would

Re: Using IDs for upload_to path

2010-09-14 Thread Scott Gould
Your ID: if it's a new object, you can't. Another field in the model: if it's calculated instead of database- provided, sure. I use UUIDs for this: def get_uuid(): import uuid return str(uuid.uuid4()) class UploadedFileModel(models.Model): physical_file =

View to serve dumpdata output

2010-09-14 Thread David Somers Harris
Is it possible to write a view which serves the JSON output of dumpdata? -- 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: can't get m2m_changed signal working

2010-09-14 Thread allyb
hi, yes, it is called in models.py, and no, it's not indented and neither is the handler function. On Sep 14, 4:28 pm, Jason wrote: > Is the m2m_changed() call in the models.py? > > Also, it looks indented - if it is, it shouldn't be - in other words - > it doesn't belong

Re: Prepopulating fields from parent, or related models, in the admin

2010-09-14 Thread nick.l...@gmail.com
Hi again! :) I haven't thought this idea through, and very well could be wildly inefficient! :) Though in your admin.py when registering the admin model do something like this: from myproject.myapp.models import MyModel, OtherModel class MyModelAdmin(models.admin): object_i_want =

Re: Tools to ease template/ui development

2010-09-14 Thread payala
I agree about Aptana. I am trying it right now and it looks very good, I already used eclipse and I think it rocks! However, re-reading my post I realise that I didn't express myself as well as I would have liked. Maybe a better title for my question would have been: OK, now we have rapid web

Looking for Django Developer(s) in & around Pune, india

2010-09-14 Thread Anand Agarwal
Hi We are looking for python/django developer in & around Pune for full time job. We require passionate people ready to work in a startup product company. Anyone interested can send me his/her resume. Thanks & Regards Anand -- You received this message because you are subscribed to the Google

Re: Tools to ease template/ui development

2010-09-14 Thread pixelcowboy
Pydev supports Django templates in Aptana, and there is also an IDE called PyCharm that is supposed to support them. I have begun learning eclipse and I like it. Eric IDE and its Django plugin is also very good, although I dont think it supports Django templates. On Sep 14, 8:20 am, payala

HTML_REMOVED

2010-09-14 Thread Bobby Roberts
i'm using django comments and when someone uses special characters in their comment (', & etc...), when it is rendered to the screen it says HTML_REMOVED... what is the fastest and best way to show the correct character instead of HTML_REMOVED. for example... in the template we have

Re: can't get m2m_changed signal working

2010-09-14 Thread allyb
hi, yes, it is called in models.py, and no, it's not indented and neither is the handler function. On Sep 14, 4:28 pm, Jason wrote: > Is the m2m_changed() call in the models.py? > > Also, it looks indented - if it is, it shouldn't be - in other words - > it doesn't belong

contrib.comments, admin section [unable to see comments]

2010-09-14 Thread Nick
Hello, I tried to troubleshoot this with Google and #django on IRC but I'm coming up empty. I've been following the practical django projects second edition book using django 1.2.3 on a local server. I have added 'django.contrib.comments' to my settings file + adjusted my urls.py file just like

Re: regular expressions

2010-09-14 Thread Imad Elharoussi
thank you I have two paramaters in my url how do I write the request function in my views.py: is it like this: def function(request, parameter1, parameter2)?? 2010/9/14 Shawn Milochik > It depends on whether it can contain whitespace or must contain > whitespace, and

Prepopulating fields from parent, or related models, in the admin

2010-09-14 Thread pixelcowboy
Hi, I want a project structure that is as follows: I have an application with project model that has a subproject, and that subproject has other subproject,etc. What I want to get is that the subproject gets the same attributes that the parent project, but is also able to override their values in

Re: Is it possible for template to use context variable as list index?

2010-09-14 Thread bruno desthuilliers
On 14 sep, 16:54, "David.D" wrote: > It's a one-to-one relationship between queryset's content and > my_list's content. > > in my view > > return object_list( request, >                                  queryset=qs, >                                  

Re: prepopulated_fields problem (+admin CSS issues)

2010-09-14 Thread nick.l...@gmail.com
If the slugs are something you're really concerned with... I would say customize the change form to work the way you want. Personally, I would rather the computer error on the side of not breaking...instead of trying to anticipate what I want it to do this time...vs next time vs a year from now.

Re: prepopulated_fields problem (+admin CSS issues)

2010-09-14 Thread Nick
Yeah that makes sense. I guess we just need to be more careful when adding live posts. Maybe it wouldn't be a bad idea to add the functionality on change if a post is anything but live. This way the slug stays relevant to the title for drafts if the editor feels like experimenting with different

Tools to ease template/ui development

2010-09-14 Thread payala
Hello everybody! This is my first post over here, I'll briefly introduce myself saying that I am an electronic engineer fiddling with a little bit of web development. After trying asp and other nasty stuff, I have discovered Django and I am LOVING it, it is just incredible. As I said, I've been

Re: can't get m2m_changed signal working

2010-09-14 Thread Jason
Is the m2m_changed() call in the models.py? Also, it looks indented - if it is, it shouldn't be - in other words - it doesn't belong to the model. On Sep 13, 1:27 pm, allyb wrote: > I'm finding it difficult to denormalise a field in a django model. I > have: > >    

Re: prepopulated_fields problem (+admin CSS issues)

2010-09-14 Thread nick.l...@gmail.com
Nick, I can answer you first question...but not really the second...hopefully someone else will come and explain that one to you... re slugs: The prepopulated_fields are working as intended. The reason being, say you've written a blog post. You've send that link out to thousands and millions of

Re: regular expressions

2010-09-14 Thread Shawn Milochik
It depends on whether it can contain whitespace or must contain whitespace, and whether that whitespace may appear anywhere in the string or only in a certain location, or after (or before) some other matched pattern. Examples: [\w\s]+ will match "word" and/or whitespace, mixed. \w+[\w\s]+ will

prepopulated_fields problem (+admin CSS issues)

2010-09-14 Thread Nick
Hello, I'm running django 1.2.3 on a local server and am still quite new to django. I was working with the "practical django projects second edition" book and implemented the prepopulated_fields option to auto populate slugs from titles. It works when I add a new post but it does not work when I

regular expressions

2010-09-14 Thread Imad Elharoussi
How do we make reference to a string that can contain a whitespace in the urls.py -- 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: Is it possible for template to use context variable as list index?

2010-09-14 Thread David.D
It's a one-to-one relationship between queryset's content and my_list's content. in my view return object_list( request, queryset=qs, template_name='my_template.html', extra_context={

Re: user created variables

2010-09-14 Thread nick.l...@gmail.com
cool glad to help! :) On Tue, Sep 14, 2010 at 12:13 AM, pixelcowboy wrote: > I see what you are saying, thanks for the advice! > > On Sep 13, 12:10 pm, "nick.l...@gmail.com" > wrote: > > The problem I see with creating a model for each data type is

Re: tracking down a login issue (django 1.2)

2010-09-14 Thread Russell Keith-Magee
On Tue, Sep 14, 2010 at 3:09 AM, Cindy wrote: > OK, I have figured this out myself -- is there somewhere I should put > in a bug report? Almost certainly yes -- but based on the details you provide, it isn't clear that the right place is Django's Trac instance. Django doesn't

django-mssql project... trying to update identity column?

2010-09-14 Thread jamescrowley
Hi guys - I'm not sure if this is the best place to post questions about django-mssql but I couldn't find any mailing list specific to that? Anyway, I'm using django-mssql with the OSQA project (http:// www.osqa.net/) but it's doing an UPDATE statement like this: UPDATE table SET

Re: Not calling clean() properly

2010-09-14 Thread Christos Jonathan Hayward
Thank you. On Tue, Sep 14, 2010 at 3:01 AM, Daniel Roseman wrote: > On Sep 13, 10:50 pm, Christos Jonathan Hayward > wrote: > > Other attempts to write a clean that would run a print statement and then > > call to_python(), validate(),

Re: Bug with distinct + aggregate ?

2010-09-14 Thread donato.gr
I managed in this way: >>> subquery = Father.objects.filter(sons__in=[adam, bernard]) >>> Father.objects.filter(pk__in=subquery).aggregate(Sum('age')) this gives the correct result. Is there a better way to do so? (maybe more efficient?) Thanks On 13 Set, 17:51, "donato.gr"

Re: django tinyMCE is normal text field instead of rich text formatting? a fix please.

2010-09-14 Thread bagheera
Dnia 13-09-2010 o 18:57:35 tricks...@googlemail.com napisał(a): I installed Django tiny mce however i am getting a normal text area in my admin. Can anyone help me to correct this to a rich text area where i can access text formatting? I just downloaded newest tinyMCE

Re: Not calling clean() properly

2010-09-14 Thread Daniel Roseman
On Sep 13, 10:50 pm, Christos Jonathan Hayward wrote: > Other attempts to write a clean that would run a print statement and then > call to_python(), validate(), and run_validators() did not result in that > print statement being called. > > Am I missing

Re: Is it possible for template to use context variable as list index?

2010-09-14 Thread bruno desthuilliers
On 13 sep, 18:20, "David.D" wrote: > In my template: > > This is ok: > {{ my_list.2 }} > > But it doesn't work: > {{ my_list.index }} > > index is a context variable (index=2) This first looks up my_list for an attribute named "index" - which resolves to the "index"

Re: Form not taking my input...

2010-09-14 Thread keynesiandreamer
Hey Daniel I was able to get my form working yay! Not sure the defaults was what I was looking for but you got me looking in the right direction. Thanks very much. -Ben On Sep 13, 2:41 pm, Daniel Roseman wrote: > On Sep 13, 9:32 pm, keynesiandreamer

Re: ModelMultipleChoiceField queryset argument does not limit widget choices

2010-09-14 Thread The Boss
> I generally do something like: > > class OrderForm(ModelForm): >     def __init__(self, *args, **kw): >         ordernumber = '%06d' % kw.pop('ordernumber', 0) >         super(OrderForm, self).__init__(*args, **kw) >         self.fields['associated_files'].queryset = >