Re: I'm missing something with Models and database migrations

2015-12-22 Thread Michael Molloy
I figured it out, again with help from Vijay. Thanks for getting me thinking in the right direction. So here is my cross reference model: class Invoice_Line_Items(models.Model): created_dt = models.DateField('created date', auto_now=True) invoice = models.ManyToManyField(Invoices) line_item

Re: I'm missing something with Models and database migrations

2015-12-22 Thread Michael Molloy
Still confused. I think I still need to create the cross reference Django model myself, and then use makemigrations to turn it into a table. I need a place to store invoices and associated line items, so if the model code I put in my first post is incorrect, what should it look like?

Re: I'm missing something with Models and database migrations

2015-12-22 Thread Michael Molloy
I was trying to create the cross reference table myself. I'm coming at this from a java/oracle background where I would create two tables (invoices and line_items), and then a third (invoice_line_item_xref) that would contain invoice IDs and associated line item IDs. I think you just helped me

Re: Migrate django project to eclipse/pydev ide

2015-12-22 Thread Clifford Ilkay
On 22/12/15 07:05 PM, Andrew Farrell wrote: Could you also tell us: 1) Why you need to switch to Eclipse specifically rather than PyCharm , SublimeText , or (the one I use) Atom

Re: I'm missing something with Models and database migrations

2015-12-22 Thread Vijay Khemlani
You have two pairs of fields with the same name (line_item_id and invoice_id), what are you trying to do exactly? Why the IntegerFields? In a Many To Many relation the columns are added to a third table between the models. On Tue, Dec 22, 2015 at 9:20 PM, Michael Molloy

Re: Persistent DB connections and WSGI

2015-12-22 Thread Jordi
Hi, Can I take for granted that connections between the DB and Django get closed when threads get killed? I take my max_connections in postgres to be the amount of WSGI threads + some safety margin, and put use Django in persistent DB connection mode (CONN_MAX_AGE = None) to avoid the

I'm missing something with Models and database migrations

2015-12-22 Thread Michael Molloy
Python 3.3 and Django 1.8 running on Openshift with a Postgresql database I'm trying to set up an Invoices table, a Line_Item table, and a cross reference between them. Here are the relevant models: class Invoices(models.Model): invoice_date = models.DateField('created date', auto_now=True)

Re: Migrate django project to eclipse/pydev ide

2015-12-22 Thread Andrew Farrell
Could you also tell us: 1) Why you need to switch to Eclipse specifically rather than PyCharm , SublimeText , or (the one I use) Atom ? 2) What error Eclipse is

Migrate django project to eclipse/pydev ide

2015-12-22 Thread Gary Roach
Hi all; I have been working on a project for some time using Ninja-IDE. Unfortunately the development on Ninja has - for all practical purposes - stopped. It no longer works for me. I need to switch to Eclipse with the Pydev plugin and am having trouble finding out how to do this. I have

makemigrations of model with single table inheritance and child fields

2015-12-22 Thread Axel Rau
Hi all, My db, which is in production (with none-Django software) has some (legacy) tables, which share a set of common fields and some fields, which differ by child. The attached single table model hierarchy worked for me, even if it’s not a legal Django arrangement. The ’type’ field is

Re: Django Model | Relationship question. Student->School Class

2015-12-22 Thread 'Tom Evans' via Django users
On Tue, Dec 22, 2015 at 6:50 AM, Pemby wrote: > With this code for example. > > class Students(models.Model): > first_name = models.CharField(max_length=30) > last_name = models.CharField(max_length=30) > classChoice1 = ? > classChoice2