Re: Is there a better way to do this?

2014-03-17 Thread Gene Coetzee
rvisors, and in turn supervisors in >> themselves can report to their respective supervisors... I developed the >> following models, but was curious if there might be a better way to do this: >> >> class Supervisor(models.Model): >> supervisor = models.OneToOneField(User)

Re: Is there a better way to do this?

2014-03-17 Thread C. Kirby
isors, and in turn supervisors in > themselves can report to their respective supervisors... I developed the > following models, but was curious if there might be a better way to do this: > > class Supervisor(models.Model): > supervisor = models.OneToOneField(User) > def __un

Re: Is there a better way to do this?

2014-03-16 Thread Gene Coetzee
isors, and in turn supervisors in > > themselves can report to their respective supervisors... I developed the > > following models, but was curious if there might be a better way to do > this: > > There will be a few different opinions on this ... here's mine: > > class Empl

Re: Is there a better way to do this?

2014-03-16 Thread Mike Dewhirst
advantage of django's built-in contrib.auth package. In Short, employees report to supervisors, and in turn supervisors in themselves can report to their respective supervisors... I developed the following models, but was curious if there might be a better way to do this: There will be a few

Is there a better way to do this?

2014-03-16 Thread Gene Coetzee
-in contrib.auth package. In Short, employees report to supervisors, and in turn supervisors in themselves can report to their respective supervisors... I developed the following models, but was curious if there might be a better way to do this: class Supervisor(models.Model): supervisor

Re: Article Viewer / Better way to do this? / Suggestions Please

2012-07-04 Thread Barry Morrison
github.com/0951804f4592c970b18b > > > > My thoughts are to use something like Django's pagination [1] > > https://docs.djangoproject.com/en/1.4/topics/pagination/ > > > > Is there a better way to do this??? > > > > Thanks! > > > > &g

Re: Article Viewer / Better way to do this? / Suggestions Please

2012-07-04 Thread Nikolas Stevenson-Molnar
ke Django's pagination [1] > https://docs.djangoproject.com/en/1.4/topics/pagination/ > > Is there a better way to do this??? > > Thanks! > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, se

Re: Is there a better way to do Django+WSGI+Apache when using multiple virtual hosts that point to the same Django installation than what I'm currently doing?

2010-04-15 Thread mw
One of my problems, as Steven mentioned in the thread above this post, is that I have to be very specific with URLs in my current setup. For example, site2.domain.com uses the same Django install as site1.domain.com, but a different application. As a result, in the urlconf I have to have

Re: Is there a better way to do Django+WSGI+Apache when using multiple virtual hosts that point to the same Django installation than what I'm currently doing?

2010-04-15 Thread Austin Gabel
Your probably better off with three separate VirtualHosts in your case. They can point to the same django project but use different settings files with a different SITE_ID for each one. This would allow you to utilize the built in Sites framework. On Wed, Apr 14, 2010 at 7:08 PM, Steven Degutis

Re: Is there a better way to do Django+WSGI+Apache when using multiple virtual hosts that point to the same Django installation than what I'm currently doing?

2010-04-14 Thread Steven Degutis
If you don't mind me jumping in here, I have a followup question (related context: I'm a django newb, this is day 3 for me) -- if you use ServerAlias, how do you specifically set django to recognize the different subdomains when a website is accessed? The urlpatterns seem to only match everything

Re: Is there a better way to do Django+WSGI+Apache when using multiple virtual hosts that point to the same Django installation than what I'm currently doing?

2010-04-14 Thread Austin Gabel
I'm assuming you are running all three of these projects on the same machine. You can use the ServerAlias directive in your config. It would look something like this ServerName host1.domain.com ServerAlias host2.domain.com host3.domain.com DocumentRoot /var/www/whatever/ WSGIScriptAlias

Is there a better way to do Django+WSGI+Apache when using multiple virtual hosts that point to the same Django installation than what I'm currently doing?

2010-04-14 Thread mw
Hello, I have multiple virtual hosts pointing to the same Django project. So something like: host1.domain.com host2.domain.com host3.domain.com each point to the same Django project because although it was required that host1 host2 and host3 should get their own hostnames, none of web apps the

Re: Is there a better way to do this with the DB API?

2007-12-06 Thread Malcolm Tredinnick
On Wed, 2007-12-05 at 20:02 -0800, globophobe wrote: [...] > class Stack(models.Model): > title = models.CharField(max_length=100) > description = models.TextField() > > def __unicode__(self): > return self.title > > class Card(models.Model): > stack =

Re: Is there a better way to do this with the DB API?

2007-12-05 Thread globophobe
On Dec 6, 10:29 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Wed, 2007-12-05 at 15:34 -0800, globophobe wrote: > Probably an easier question to answer if we could see the models > involved (and perhaps an English description of what you are wanting to > achieve). My gut feeling is that

Re: Is there a better way to do this with the DB API?

2007-12-05 Thread Malcolm Tredinnick
On Wed, 2007-12-05 at 15:34 -0800, globophobe wrote: > I've read the documentation. I admit to being more than a little > deficient with databases. Can anybody suggest a better way? > > if len(study) < 20: > exclude = user.study_set.filter(stack=stack).values('card') > cards =

Is there a better way to do this with the DB API?

2007-12-05 Thread globophobe
I've read the documentation. I admit to being more than a little deficient with databases. Can anybody suggest a better way? if len(study) < 20: exclude = user.study_set.filter(stack=stack).values('card') cards = stack.card_set.exclude(id__in=[i.get('card') for i in