Re: limiting the drop down option of a one-to-one relationship in the admin app. is that possible ?

2017-01-29 Thread Melvyn Sopacua
On Saturday 28 January 2017 21:48:03 Mike08 wrote: > Ok that makes sense. > > Now I have something like this > > class modelStudentAdmin(admin.ModelAdmin): > form = modelStudentAdminForm > > #Only display students that belong to this user > def get_queryset(self, request): >

Re: limiting the drop down option of a one-to-one relationship in the admin app. is that possible ?

2017-01-28 Thread Mike08
Ok that makes sense. Now I have something like this class modelStudentAdmin(admin.ModelAdmin): form = modelStudentAdminForm #Only display students that belong to this user def get_queryset(self, request): qs = super(modelStudentAdmin, self).get_queryset(request) if r

Re: limiting the drop down option of a one-to-one relationship in the admin app. is that possible ?

2017-01-28 Thread Mike08
I am not sure if i understand this are you suggesting that i return a form instead of a queryset ? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users

Re: limiting the drop down option of a one-to-one relationship in the admin app. is that possible ?

2017-01-28 Thread Melvyn Sopacua
On Saturday 28 January 2017 18:21:34 Mike08 wrote: > now my question is in the admin when the user attempts to create a new > modelStudent for the field "user" all available users are shown in > the drop down. My question is if there is a way for me to > limit/restrict that drop down to a certain

limiting the drop down option of a one-to-one relationship in the admin app. is that possible ?

2017-01-28 Thread Mike08
I currently have a model that looks like this class modelStudent(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE,null=True, blank=True) school = models.ForeignKey(modelSchool) Now I also have a modelStudentAdmin of the above model which basically filt

Re: One To One relationship with a generic relation?

2012-01-27 Thread snow leung
no way On 1月15日, 上午9时15分, Stodge wrote: > I've used generic relations and they worked, but in one particular > case I need a one-to-one generic relation. Is this possible? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

One To One relationship with a generic relation?

2012-01-14 Thread Stodge
I've used generic relations and they worked, but in one particular case I need a one-to-one generic relation. Is this possible? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. T

One-to-One relationship

2008-01-11 Thread Narso
Hi, When I have put a models.OneToOneField in a model, the changelist page of the related model, lost the filtering box. Why? I had tried to make this manually, changing the field to models.ForeignKey field, with a PrimaryKey attribute set. Then I got a Select SQL Error. I need both OneToOneFiel

Re: One-to-one relationship (model inheritance) or generic relations?

2007-06-29 Thread Jamie Pittock
Russ, Really useful response, thanks. I had thought about your third option but as I figured there'd be a lot of empty fields I didn't give it much consideration. I might actually go down that route until I have a better understanding of generic relations. Thanks again. j. On Jun 29, 2:20 am,

Re: One-to-one relationship (model inheritance) or generic relations?

2007-06-28 Thread Russell Keith-Magee
On 6/28/07, Jamie Pittock <[EMAIL PROTECTED]> wrote: > > I don't want to code myself into a corner, so when I start looking at > features such as allowing users to search all venues would I be best > with one parent model or will I be ok keeping them separate? The > different types of venues hav

One-to-one relationship (model inheritance) or generic relations?

2007-06-28 Thread Jamie Pittock
I'm still new to Django so bear with me ;) I have models for different types of venues (Bars, Clubs, etc). Because for example, I'd like to use one Rating model across all these venue Models I'd presumed that I'd need a parent Venue Model, using some kind of one-to-one relat

unique=True, one to one relationship

2006-06-30 Thread bernadet
1- if I combine related objects in the same page (by using the edit_inline attribute), and add to one of the fields the unique atrribute (unique=True), when trying to save the page, i got the following exception: Exception Type: TypeError Exception Value: Cannot resolve keyword 'username' into fi

Re: one to one relationship and file upload issue

2006-06-08 Thread Jeremy Jones
I was at a changeset more recent than 3002. Can't recall which revision number it was, but it was circa June 2. I figured that wasn't it, played around with MySQL a bit more, uninstalled all but a specific version of the MySQL client, reinstalled MySQL_python, turned on MySQL logging, and was pe

Re: one to one relationship and file upload issue

2006-06-08 Thread arthur debert
Could this be it http://code.djangoproject.com/ticket/572 or http://code.djangoproject.com/ticket/1584 ? me thinks this was fixed recently. => http://code.djangoproject.com/changeset/3002 are you running an up to date svn version? see if that helps --~--~-~--~~~--

Re: one to one relationship and file upload issue

2006-06-08 Thread Jeremy Jones
I wouldn't think it would take multiple seconds to process the file I'm trying to upload, still. I'll just see how it handles things in production. I'm seeing more problems, though, with how the admin interface is dealing with my version of MySQL. At least I think Django is having a problem wi

Re: one to one relationship and file upload issue

2006-06-08 Thread arthur debert
Hi james, regarding: > when I upload a file (a 10+MB mp3) on my local machine, it > takes quite a while and pegs the CPU. Is this expected and is this > going to be the behavior when I put it in production under fastcgi? django keeps the whole upload in memory. this has been discussed a few times

one to one relationship and file upload issue

2006-06-08 Thread Jeremy Jones
I'm having two issues within the same app. First, maybe I just got a bad batch of crack, but I could've sworn things were working differently the other day. I have one model class (Podcast) that has a one to one relationship with another (Post). I could've sworn that the other d

Re: Model inheritance, Python subclass or one-to-one relationship?

2005-10-30 Thread Dado
SQLObject uses "Class Table Inheritance". I would say that giving the developer a choice of STI and CTI (perhaps via an option in META) for different use cases it's the best solution. If not possible, I would go with CTI!!! I am a Django newb but I would really love to implement what I have in m