Re: Is it possible to combine these two queries?

2009-07-30 Thread Tim Chase
> al_1 = Alert.objects.filter(creation_date__regex=today).values > ('dimension1').annotate(Sum('metric1')).order_by('dimension1') > > and > > al_2 = Alert.objects.filter(creation_date__regex=yesterday).values > ('dimension1').annotate(Sum('metric1')).order_by('dimension1') > > They are almost t

Re: Django 1.1 returns 500 instead of 404 in non-debug mode

2009-07-30 Thread Luke Seelenbinder
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Prabhu, Let's establish the reason the 404.html doesn't show on a supposed 404 error; that is because every single request on the output you posted a little while ago from the server is responded with a 500 error. Something is fouled up with the vie

Re: Template links when Django not domain root

2009-07-30 Thread Graham Dumpleton
Using FORCE_SCRIPT_NAME is only appropriate for certain WSGI hosting mechanisms. Using it may simply hide the fact that the OPs application code is wrong to begin with. OP should indicate how they are hosting their application for real site. Ie., mod_python, mod_wsgi, fastcgi or other. Graham O

Re: Removing objects with many-to-many relationship

2009-07-30 Thread Brian May
On Thu, Jul 30, 2009 at 04:47:05AM -0700, rudy wrote: > class ContentTopic(models.Model): > name = models.CharField() > code = models.CharField() > > class ContentItem(models.Model): > topic = models.ManyToManyField(ContentTopic, db_index=True, > blank=True, related_name='content_item

Re: Template links when Django not domain root

2009-07-30 Thread Streamweaver
I'm not actually using {% url %} at this time. I am setup for mod_wsgi and don't know how to go about configuring links in the templates when the sites root is on a subdirectory. There isn't much in the way of examples on FORCE_SCRIPT_NAME I can find and I'm not really an apache admin so I'm a b

Re: Weird character shifting in mod_python

2009-07-30 Thread Graham Dumpleton
On Jul 31, 9:27 am, Andrew wrote: > We get these incredibly bizarre errors every once and a while where a > single character of python gets transformed. The code itself isn't > changing, and the area where it pops up changes each time. Any ideas? > > MOD_PYTHON ERROR > > ProcessId:      28165 >

Re: Template links when Django not domain root

2009-07-30 Thread Graham Dumpleton
If you are using mod_wsgi then you definitely do not need FORCE_SCRIPT_NAME as mod_wsgi does the correct think in respect of setting up SCRIPT_NAME/PATH_INFO. The only time it might not be right with mod_wsgi is if you used WSGIScriptAliasMatch to map the application and you didn't set up the dire

"join" query in Django?

2009-07-30 Thread Asinox
Hi, guys, how or where is the "join" query in Django? i think that Django dont have "join"..but how ill make join? Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Re: "join" query in Django?

2009-07-30 Thread Malcolm Tredinnick
On Thu, 2009-07-30 at 21:23 -0700, Asinox wrote: > Hi, guys, how or where is the "join" query in Django? > > i think that Django dont have "join"..but how ill make join? SQL-level joins happen automatically when required. You specify your queryset in terms of filter() and exclude() calls and Dj

quick question: how to have *.domainname.com url in django

2009-07-30 Thread weiwei
Hello all, I know there are lots of example for how to set http://domainname.com/* url. But how to have http://*.domainname.com url in django? Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django user

Re: quick question: how to have *.domainname.com url in django

2009-07-30 Thread Graham Dumpleton
On Jul 31, 3:09 pm, weiwei wrote: > Hello all, > > I know there are lots of example for how to sethttp://domainname.com/* > url. But how to have http://*.domainname.com   url in django? Really depends on what you are trying to achieve and how you are hosting Django. Apache provides a way of h

Re: quick question: how to have *.domainname.com url in django

2009-07-30 Thread weiwei
thanks, i was thinking to have each user have a url as http://username.domain.com/ like http://hiphopo.posterous.com/ On Jul 30, 10:20 pm, Graham Dumpleton wrote: > On Jul 31, 3:09 pm, weiwei wrote: > > > Hello all, > > > I know there are lots of example for how to sethttp://domainname.co

Re: How to save a model...

2009-07-30 Thread zayatzz
I did some thinking over night, but still cant figure this one out on my own :) If i want to save foreign key like this, then what should i send to another model, if another object will not work? Alan. --~--~-~--~~~---~--~~ You received this message because you are

Re: custom admin actions

2009-07-30 Thread selcukcihan
Thanks Vasil, it works as suggested On Jul 31, 2:52 am, Vasil Vangelovski wrote: > You can get the model class for the modeladmin, it's the model property. So > modeladmin.model will give you the model class. You can just do a > check of equality > modeladmin.model == OurModel. > > On Thu, Jul 3

Finding a Django expert to review my code

2009-07-30 Thread Rex
I just created my first Django site (as an academic research project). Now that it is done, I would like to get feedback on my code from a Django expert so that I can learn where I can improve as a Django dev. How can I find someone to spend 1 or 2 hours reviewing my code with me? I found a few em

Re: Subclassing CharField

2009-07-30 Thread Michael Anckaert
Just a simple class MyCharField(forms.CharField): pass to start out On Jul 30, 11:12 pm, Xiong Chiamiov wrote: > On Jul 30, 7:27 am, Michael Anckaert > wrote: > > > Hello everyone, > > > I subclassed the CharField but have run into this problem: > > How did you subclass CharField?  It's diff

Re: Finding a Django expert to review my code

2009-07-30 Thread Daniel Brown
Good evening Rex, I'm a beginner to Python and Django and I've found running my scripts through PyLint (http://pypi.python.org/pypi/pylint) to be very worth while. Regards, Daniel 2009/7/30 Rex : > > I just created my first Django site (as an academic research project). > Now that it is done,

Re: Finding a Django expert to review my code

2009-07-30 Thread Ben Atkin
I'd probably try emailing some of the top Django developers. This seems like it would be a buyer's market, due to the job being short and fun for a dedicated Django dev. Don't hire a noob like me. ;) http://code.djangoproject.com/wiki/DevelopersForHire Ben On Thu, Jul 30, 2009 at 11:21 PM, Rex

Re: Finding a Django expert to review my code

2009-07-30 Thread Parag Shah
Hi Rex, I am not a django expert (in fact I have just started working with Django about a month back), but I have been in software development for a while. Remote code review sounds like an interesting exercise. I will be glad to help you with the review, but with no prior promises on the outcome

Re: "join" query in Django?

2009-07-30 Thread Asinox
Thanks Malcom for replay, but, is not working for me, i think that is simple just .filter("field1__field2"), but i cant make the join i try with .filter("field1__field2") where the field1 is the PK and the field2 is the FK. here is my query: p = Diligencia.objects.filter(Q(socio=request.user.id)

Re: How to save a model...

2009-07-30 Thread Malcolm Tredinnick
On Thu, 2009-07-30 at 12:33 -0700, zayatzz wrote: > ... Hello! > > I have a model (profile) which's only required field is its foreignkey > - django.contrib.auth.User. > > Following the example of forementioned model and its manager i created > manager for the profile: > > class ProfileManager(

<    1   2