Re: need help designing models

2013-04-07 Thread Mike Dewhirst
On 7/04/2013 4:36pm, surya wrote: actually, you are right, django models do provide id.. but this uid field is something else.. Eg: massachusetts institute of technology. uid = MIT..i will be using it as primary key. Doing so raises questions about investing primary keys with real meaning.

Re: need help designing models

2013-04-07 Thread surya
On Sunday, April 7, 2013 11:42:50 AM UTC+5:30, Mike Dewhirst wrote: > > On 7/04/2013 3:27pm, surya wrote: > > Consider a university college. > > 1. College has name, uid, website > > 2. Each college has a many departments - Each department has name, uid. > > 3. Each batch in a department has

Re: need help designing models

2013-04-07 Thread Mike Dewhirst
On 7/04/2013 3:27pm, surya wrote: Consider a university college. 1. College has name, uid, website 2. Each college has a many departments - Each department has name, uid. 3. Each batch in a department has name, and ratings. *from django.db import models* * * *class College(models.Model):* *name

Re: need help designing models

2013-04-07 Thread Pankaj Singh
College field in Batch model is redundant. You can get college of a batch using batch.department.college. On Sun, Apr 7, 2013 at 10:57 AM, surya wrote: > Consider a university college. > 1. College has name, uid, website > 2. Each college has a many departments - Each

need help designing models

2013-04-06 Thread surya
Consider a university college. 1. College has name, uid, website 2. Each college has a many departments - Each department has name, uid. 3. Each batch in a department has name, and ratings. *from django.db import models* * * *class College(models.Model):* * name =

Re: Need help with models

2009-01-24 Thread Adrián Ribao
Do you use a custom Model Manager or something similar to make it optimal? I'm using this approach now but it needs to make a query for every element, which is not very efficient. I'd be happy if one of the django "brains" tell us how could we do this. Thank you. On 24 ene, 21:07, Kless

Re: Need help with models

2009-01-24 Thread Kless
I also was looking for a solution for it and I found that the most optimal is the first approach --at least for me--. You have a normal table with data entered into a language by default, and then it's used another one to translating the text fields from that main table. The difference with

Need help with models

2009-01-24 Thread Adrián Ribao
Hello everybody, I need to create dinamic content in several models. I have 3 approaches: approach 1: class News(models.Model): date = ... visible = ... text = models.CharField(max_length=255) class NewsTrans(models.Model): news = models.ForeignKey(News) lang =