Re: Simple Sitemap

2009-10-12 Thread Adam N
You might as well use django.contrib.sitemaps. It's not difficult to use that app so there's no more efficient way to do this unless you happen to have the sitemaps.xml file already. On Oct 12, 11:32 am, Timbadu wrote: > I need a simple sitemap for 5 URLs. The

Re: How to define a "has-a" relationship in dJango models

2009-09-17 Thread Adam N
> > wrote: > > > > Thanks Karen. > > > Let me explain it a bit more. > > > e.g. > > > All CONTACT details are present in one table - email, home address, > > > work address, home phone, work phone etc. > > > Forget about the statement about growing for now. > > > Since

Re: Development and deployment wit Git

2009-09-14 Thread Adam N
Orschiro, You should definitely use a service like GitHub.com unless you have a good reason not to. They have all the rough edges worked out and you get a great web interface for everything. In addition, sharing becomes much easier if you're working with other GitHub projects. If/When you

Re: Populating ChoiceField values in Form

2009-09-11 Thread Adam N
> class TestForm(forms.ModelForm): >     category = forms.ModelChoiceField(queryset=TestModel.objects.filter > (filtercriterion__id=1)) > >     class Meta: >         model = TestModel > > In this example, TestModel.objects.filter(filtercriterion__id=1) will > return a QuerySet of what I want to

Re: Design Tools any suggestions?

2009-07-11 Thread Adam N
GraphModels in django-extensions can be helpful. http://code.google.com/p/django-command-extensions/wiki/GraphModels I had a bear of a time installing it on my Mac however. Graphviz isn't Visio or a UML editor though so the utility of that program for model designing is kind of limited. On

Re: django nginx fastcgi and flup

2009-06-16 Thread Adam N
I actually had issues with my most recent installation. These are the instructions I wrote/use and am currently maintaining. Strangely, it worked on my previous two installations ... http://wiki.nginx.org/NginxPythonFlup I'm using nginx version: nginx/0.6.35 Any assistance on those wiki

Re: Running Django admin site using Lighttpd

2009-04-09 Thread Adam N
On Apr 9, 10:51 am, Daniel Roseman wrote: > On Apr 9, 3:35 pm, Karim Hamdan wrote: > > > Let me rephrase my question. I followed > > thisHowTo > > on this group that

Re: Ignore Fixtures or Skip Fixtures

2009-04-08 Thread Adam N
On Apr 8, 11:13 am, Russell Keith-Magee wrote: > On Wed, Apr 8, 2009 at 10:27 PM, Adam Nelson wrote: > > > Is there any way to ignore fixtures when running syncdb?  I'm using > > django-command-extensions and when using runscript from a previous > >

Re: django.contrib.auth user password decryption

2009-04-05 Thread Adam N
A good solution is to reset the password through the screen. 1. Validate the user through some sort of test (secret question or something). 2. Then send them to a screen where they can reset the password themselves to whatever they want. 3. Initiate an email to the stored email address notifying

Re: Error creating test database

2009-04-02 Thread Adam N
I'm pretty sure you'll need to make it an abstract model. You could make the model that accords to the existing table abstract and then subclass that model with no additional attributes (except a different name) - that will give you access to the data directly if you need it while leaving the

Re: Fixtures for django.contrib.sites.Site

2009-04-02 Thread Adam N
Thanks a ton - that's exactly what the issue was. On Apr 1, 8:28 pm, Russell Keith-Magee wrote: > On Thu, Apr 2, 2009 at 5:49 AM,AdamNelson wrote: > > How do I do a fixture for the Site model?  I've tried all sorts of different > > model names > > [ > >  

Re: Mod_wsgi and mod_python

2009-04-02 Thread Adam N
You should definitely consider Nginx with FastCGI. Something like this: http://wiki.nginx.org/NginxDjangoFastCGI On Apr 2, 2:20 am, Pythoni wrote: > I am using Django with mod_python and it works but during peak times > ( heavy loads about 50 Apache jobs), the system is almost

Re: Order_by number of foreign key joins

2009-03-10 Thread Adam N
You can do this by changing the Thing model: http://docs.djangoproject.com/en/dev/ref/contrib/contenttypes/#reverse-generic-relations class Thing(models.Model): ... otherthing = generic.GenericRelation(OtherThing) For each thing, when you run thing.otherthing.all(), you'll

Re: Best practise of using custom sql with Stored Procedure

2009-03-10 Thread Adam N
Tim, Here is how I do it with a different query. Using the fetchall() and getting it into a list works nicely. I know that there should be a better way to do this so that we're not making a list twice - but this works: query = """SELECT b.created_on, SUM(a.vote)