Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
No Safe Word
Feb 26, 2005

Yeah buddy, theonion.com is now Django-powered according to Adrian's latest tweet: http://twitter.com/adrianholovaty/status/10930210800

Adrian Holovaty posted:

This is easily the most proud and excited I've ever been about a Django development: theonion.com is now Django-powered.

Adbot
ADBOT LOVES YOU

No Safe Word
Feb 26, 2005

Doh004 posted:

Quick theory question:

I have three models: A,B,C. A relates to B, B relates to C. Therefore, A relates to C; however, I'd have to go through B in order to get C's info from A. Would it be a better decision just to add a direct relationship between A and C? I believe it would increase performance; however, it'd be another thing to include in my model.

What's the correct way to go about this?

Basically you're just denormalizing there. You can do that and it would indeed up your storage requirements but would be faster, that's the typical tradeoff with database design. You also would have to worry about maintaining the correct relationship to C in both places (ie, updating one you'd have to update the other or they'd be inconsistent).

Short answer: leave it A->B->C for now and if you absolutely have to beef up the speed later for whatever reason, deal with it then (use South for an easy model migration)

No Safe Word
Feb 26, 2005

Quick, register for Django Dash

http://djangodash.com/

Registration closes Saturday! Competition starts next Friday!

No Safe Word
Feb 26, 2005

Innocent Bystander posted:

I'm a noob with SQL and Django, and I'm trying to duplicate the schema from a .sql file and I'm not sure how to duplicate this entry:

code:
CREATE TABLE entries
(
    WarningLevel int NULL,  # This line here
    MessageInfo text,
    UserID int,
)
In my my model would I define the noted line like this?

code:
WarningLevel = IntegerField(null = True)
Thanks.
Django can introspect your database for you if you want.

https://docs.djangoproject.com/en/dev/howto/legacy-databases/

But yes, that's pretty much what it would be. To be sure, use the introspect command from the link above.

No Safe Word
Feb 26, 2005

jarito posted:

Just getting started with a project at work in Django. The app is a pure ReST interface (no web front end). I've noticed there are some plugins for making ReSTful Django interfaces, but the basic Django handlers and stuff seem like they would work fine.

For a pure ReST interface app, should I use a library / plugin? Or just use the basic handlers from Django?

Just so you don't get confused later on, ReST is for ReStructured Text, whereas REST is never abbreviated like that, it's pretty much always all caps.

Adbot
ADBOT LOVES YOU

No Safe Word
Feb 26, 2005

duck monster posted:

Would creating a django-south fixture with a few million records be a really stupid thing to attempt?

Why would it be? Though at that point you might just consider a true database backup to restore from.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply