Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3939914
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T00:21:21+00:00 2026-05-20T00:21:21+00:00

I have a project that I wrote in PHP/symfony that uses 45 tables. I’m

  • 0

I have a project that I wrote in PHP/symfony that uses 45 tables. I’m in the process of porting it to Python/Django.

There’s a belief I’ve held for years that you should split up your projects into a bunch of small files rather than a few huge files. From what I understand, that’s not an odd thing to believe. In Rails and symfony, there’s a one-model-per-file convention. In Django, however, it seems that most developers put all of each app’s models in one file.

This makes sense to me if your apps are each small enough. It doesn’t make sense to me for large apps, though, and what I have is at least one large app.

Out of the 45 tables my project uses, 35 are closely related. I have a script that imports data from CSV files. For each line in each CSV file, I save 50-80 pieces of data into 30-35 different tables in one fell swoop.

Maybe I’m just thinking about this the wrong way but it would seem incredibly odd to me to divide my project into 6 or 7 different apps when almost all my tables are inextricably linked. When I touch one table, I touch all 35 tables. The delineations would have to be arbitrary. What would be the point of that?

Please forgive me if I come off as biased because I certainly am biased. I’m not having this problem in symfony and I wouldn’t be having it in Rails. (I chose Django because of GeoDjango and Python’s GIS capabilities.)

  • In a perfect world, I would have one model per file.
  • If I try to have one model per file, I get circular reference problems.
  • I could avoid the circular reference problems by putting all my models in one file but that feels wrong to me.
  • I could avoid putting all my models in the same file by splitting them into separate apps, but in order to end up with sufficiently small apps, I’d have to break up my project in arbitrary (and therefore pointless) ways.

What should I do?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T00:21:21+00:00Added an answer on May 20, 2026 at 12:21 am

    If having one model per file would be the perfect answer for you, there’s an app for that.

    I’ve never done it on a scale of 80 model files but I can certainly point you towards another stack question:
    About 20 models in 1 django app

    http://djangosnippets.org/snippets/1838/

    What kind of circular reference problems are you having by the way? If it’s with ForeignKey definitions, here’s a way around that…
    http://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.ForeignKey

    You can also look into django.db.loading.get_model, but some may frown on this.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a project that has a makefile with broken dependencies. Is there any
I have several small open-source projects that I wrote. All my attempts to find
I have a console application project in C# 2.0 that needs to write something
I have project that I'm working on that is going to require a webserver.
I have a project that I'm currently working on but it currently only supports
I have a project that I would like to start beta testing soon, it
I have a project that I'm working on and I need to be able
We have a project that generates a code snippet that can be used on
I have a project that I thought was going to be relatively easy, but
I have a project that I am building with Netbeans 6.1 and I am

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.