Re: Migrations and multiple databases

2016-11-25 Thread odd hogstad
Isn't that kind of stupid? fredag 25. november 2016 06.00.49 UTC+1 skrev pradam.programming følgende: > > Yes do the same. > > On Thu, Nov 24, 2016 at 11:16 PM, odd hogstad > wrote: > >> db1 holds the auth stuff already. Do I need to also have it in db2 f

Re: Migrations and multiple databases

2016-11-24 Thread odd hogstad
he issue > > On Thu, Nov 24, 2016 at 3:54 PM, odd hogstad > wrote: > >> I have two databases in my project, db1, which changes quite frequently, >> and db2, which seldom changes. The app was original written in django 1.3, >> but we've upgraded since then, an

Migrations and multiple databases

2016-11-24 Thread odd hogstad
I have two databases in my project, db1, which changes quite frequently, and db2, which seldom changes. The app was original written in django 1.3, but we've upgraded since then, and now uses 1.8. Now I need to make a change on db2 for the first time since the upgrade from 1.3. I make my change

Get last object with certain value

2010-06-11 Thread Odd
maybe a better solution? Thanks! Odd-R. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@g

Attribute in model not in database

2010-04-20 Thread Odd
I have this model: class MyModel(models.Model): name = models.CharField(max_length=100) myList=[] If I add values to myList, for how long will it be available there? Is this a bad approach? Thanks! Odd-R. -- You received this message because you are subscribed to the Google

Re: Custom widget for a modelform field

2010-03-08 Thread Odd
It works fine if I'm not using a modelform, i.e. class MyForm(forms.Form): data=forms.CharField(widget=MySelect()) Can one not use a custom widget in a modelform? Thanks. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this grou

Custom widget for a modelform field

2010-03-08 Thread Odd
I'm trying to write a custom select widget for a modelform field, but the render method of the widget doesn't seem to get called. This is how I define the modelform: class MyForm(ModelForm): class Meta: model=MyModel fields=('data',) widgets = { 'data': MyS

Re: ForeignKey query

2010-01-29 Thread Odd
On 29 Jan, 09:52, Odd wrote: > On 29 Jan, 09:08, Odd wrote: > > > >You originally say the model1 > > > has a foreign key to model2 - I interpret that to mean that the > > > ForeignKey is defined on model1. However, your code references > > > model1.mod

Re: ForeignKey query

2010-01-29 Thread Odd
On 29 Jan, 09:08, Odd wrote: > >You originally say the model1 > > has a foreign key to model2 - I interpret that to mean that the > > ForeignKey is defined on model1. However, your code references > > model1.model2_set - which would imply that the FK is defined on > &

Re: ForeignKey query

2010-01-29 Thread Odd
>You originally say the model1 > has a foreign key to model2 - I interpret that to mean that the > ForeignKey is defined on model1. However, your code references > model1.model2_set - which would imply that the FK is defined on > model2, pointing to model1. So, do you want the objects that are > po

ForeignKey query

2010-01-28 Thread Odd
ite new to both django and python. Can anybody please give me a hint of a better solution? Thanks! Odd-R. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubsc

List as filterinput, possible?

2010-01-17 Thread Odd
I have this query: myDevices=Device.objects.filter(group=groups) where groups is a list. What I want is get all the devices that is in one of the groups in the list groups. If group only has one element, everything goes as expected. But if groups has more than one element, which is often the case,