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
m0nk3yz
Mar 13, 2002

Behold the power of cheese!

ATLbeer posted:

I'm going to be at PyCon next week. If I run into any of the Django guys I'll mention it because I want a shirt that looks decent too.

Nice, I think there's going to be more than a few of us there.

Adbot
ADBOT LOVES YOU

m0nk3yz
Mar 13, 2002

Behold the power of cheese!
Ok. Python Oldie, but Django newbie question ahead:

I'm building a django app that will have a series of test cases tracked within it (yay it will be open source). Each test case has a an object (from the model) that looks like this:

code:
class TestCase(models.Model):
    VALID_STATES = ( ('N', 'NEW'),
                     ('A', 'ACTIVE'),
                     ('I', 'INACTIVE'),
                    )

    shortname = models.CharField(max_length=150)
    expected_result = models.TextField()
    author = models.ForeignKey(User, to_field="username")
    component = models.ForeignKey(Components)
    last_modified = models.DateField(auto_now=True)
    created = models.DateField(auto_now_add=True)
    state = models.CharField(max_length=10, choices=VALID_STATES)
    automated = models.BooleanField()
    manual = models.BooleanField()
    procedure = models.ManyToManyField(ProcedureSteps)
    # TBD: replace with tagcloud impl.
    attributes = models.CharField(max_length=150)
    notes = models.TextField()

class ProcedureSteps(models.Model):
    category = models.CharField(max_length=30)
    text = models.TextField()

    def __str__(self):
        return self.text
The question I have is this - for the procedure field, it actually points to a ProcedureSteps object that has category and name attributes.

A "procedure" (as related to the test case) can have multiple ProcedureSteps associated with it. A procedure "step" could be related to multiple test cases. This is "easy" in that I can just add a bunch of ProcedureSteps to the table, and use the Django admin to create a select box. However, what I need is to keep the list of ProcedureSteps for the TestCase enumerated - step 1 must always be step 1. I also want to create an admin form which starts with 2 "edit" rows for the procedure attribute of the test case, and users can "add" a step. I also don't want to create a "procedure table" for each test case - that seems excessive for something that could have 100k+ entries in the test case table.

The steps then must be stored and then displayed in the same order they were added to the test case. I want to shared all previously entered ProcedureStep with all new and old test cases, so people can pick from a category of steps, then select a pre-entered ProcedureStep.

So, I'm not terribly good with databases - or django. Any of you have a suggestion on how to structure the model and possibly render this in the admin? I feel stupid.

m0nk3yz fucked around with this message at 18:49 on Sep 4, 2008

m0nk3yz
Mar 13, 2002

Behold the power of cheese!
I wish you for to help me make better django!

I just released the most rudimentary prototype of the test-engineering application I've been farting around with, and I am looking to get everything from django, to basic layout/design feedback. This web thing is hard.

http://code.google.com/p/testbutler/

I'm currently refactoring the templates to use extends and cleaning up the hanging mess I left in a few areas.

m0nk3yz
Mar 13, 2002

Behold the power of cheese!

bitprophet posted:

I keep forgetting you're Jesse Noller, and so I'll see your blog post in my feed (assuming it's the Django community feed, either that or Planet Python) and then run across a post here a few hours later and do a double-take :)

Looks like a neat app (from reading the main google code page -- it's not really something in the vein of CruiseControl, is it? because it's designed to track manual testing as well as automatic) and it sounds like you're definitely trying to do things The Right Way, which is always great!

I can indirectly recommend James' book, especially after reading his DjangoCon slides, which rocked. Plus I know him from #django and he's a smart cookie.

I'd also recommend my book but it's not quite out yet v:shobon:v and we don't go into the philosophy as heavily as James probably does (ours being more of a well-rounded book instead of focusing solely on app design).

It's the Python Planet feed - my Django Fu is so weak, I don't think I could be there :)

Yes - this is not a Cruise Control application in some sense - think of it as a inventory/tracking system for Test Engineering collateral. Test Cases, Test Plans - things like "run" creation for tests targeted at releases and sprints/etc.

When your book is out, I'll definitely pick it up. The hardest part for me from an application standpoint isn't the back end - hell, I was able to retrofit some links into the 2.6 multiprocessing module just as a lark super-easy. The problem for me is in the templates - the actual user-interface design of things. I get trapped in a fortress of stupid with all of the XHTML/CSS/JavaScript/etc stuff and can't seem to find my way out.

Django makes the back end stupidly easy.

m0nk3yz
Mar 13, 2002

Behold the power of cheese!

bitprophet posted:

Guess it depends on what exactly you need to do with those values on the query side of things, but it could be an OK choice, nothing obviously wrong with it that I can see.


Also, hooray! the book is officially out. Got my hard copies last night. Here's a crappy iPhone photo:

Hooray! Tell me it's updated for 1.0 :)

Also, slightly off topic - I've started fleshing out an outline for a book I'm pondering, except I've never written something that expansive - I'd be interested in hearing how you approached it and how it went for you.

m0nk3yz fucked around with this message at 14:09 on Oct 31, 2008

m0nk3yz
Mar 13, 2002

Behold the power of cheese!

bitprophet posted:

Take a closer look at the photo ;) specifically the upper right quadrant. Think circles.

I am a failure.

m0nk3yz
Mar 13, 2002

Behold the power of cheese!
bitprophet, I bought your Django book >_< it better not suck

m0nk3yz
Mar 13, 2002

Behold the power of cheese!

king_kilr posted:

Somehow I imagine m0nk3yz jumping straight up to Marty's book within a week.

I like fiction!

m0nk3yz
Mar 13, 2002

Behold the power of cheese!
Also, if anyone knows anyone, I'm looking for a senior-or-higher level web person, preferably someone with Django experience. (in MA)

m0nk3yz fucked around with this message at 02:59 on Mar 13, 2009

m0nk3yz
Mar 13, 2002

Behold the power of cheese!

bitprophet posted:

Yea, probably. Ours is aimed more at beginner/intermediate folks coming from PHP. Still a decent overview, though.

But hey, he already bought it, so that's another $0.90 for me...

I have Marty's book, James' book, the "main" book, and bitprophet's book. I'm reading them all relatively simultaneously. It's been awhile since I've needed to do any large amount of web-programming, so I am trying to absorb as much as possible. Also, I hate HTML :(

m0nk3yz
Mar 13, 2002

Behold the power of cheese!

king_kilr posted:

Just use a user profile model, that's how it's done. Needing to hook up a signal reciever and handle 2 ModelForm's isn't difficult, it's like 10 lines of code.

Man if only we had an example

m0nk3yz
Mar 13, 2002

Behold the power of cheese!

chips posted:

Still isn't showing new admin models.

code:
user@ubuntu810server:~/mysite/apache$ cat /etc/apache2/httpd.conf
WSGIScriptAlias / /home/user/mysite/apache/django.wsgi
code:
user@ubuntu810server:~/mysite/apache$ ls -l
total 4
-rwxr-xr-x 1 user user 235 2009-07-25 02:30 django.wsgi
Could this be misconfigured paths? Though I'm not seeing how that'd stop it finding a source file in the same location as every other.

Are you running in daemon mode, or embedded mode?

m0nk3yz
Mar 13, 2002

Behold the power of cheese!

duck monster posted:

I hear you man. I adore django, but occasionally I want to start punchups with it for letting you put functions outside of classes. I grew up on smalltalk (hence my Obj C love) so Im a bit of an OO zealot.

First class functions are the loving balls - and it's a python thing - not Django :smug:

m0nk3yz
Mar 13, 2002

Behold the power of cheese!

nbv4 posted:

So they announced djangocon. I was thinking of going until Is saw how much it costs. Five hundred freaking dollars per person. Why does it cost so much? I haven't been to a "con" like this before, but that seems like a lot of money. I've been to job fairs before that costs $100 which I thought was a lot, even though the price included a fancy catered lunch. Does Djangocon at least include kick rear end food? If one hundred people show up, thats $50,000 of gross income. Does it really costs that much money put put on a "con" of this nature?

I don't know why you're putting "con" in quotes.

But to your question; I've found most python conferences well worth the price of admission - but I would note that prices of the DjangoCon tickets is surprising to me. Tickets to a lot of conferences have been going up though - and typically, the tickets are not profitable to the organizers - the money goes to pay for the hotel rooms and costs, and the most expensive item - food and snack catering.

Really, seeing behind the scene at Pycon as I have, it doesn't surprise me to see expensive tickets (even if the cost is more than I'd expect) for DjangoCon - the hotels (and especially, the catering people) love to stick it in your throat whenever they can.

So, essentially I can see justification for the price from a pure contract-with-the-hotel-and-catering-people standpoint, I imagine the organizers found the best hotel deal they could (or were locked into a multi year contract) and are paying for it now. Unless you're in a good negotiating position, hotels and the other groups will totally molest you.

As for "will the content be worth it" - I don't even miss a beat when I say yes. It will be. Like PyCon, the content will be high quality, there will be a lot of it, and you will get the best thing ever out of it - exposure to other people working with it. The networking, sprinting and hallway track is almost worth it alone.

Adbot
ADBOT LOVES YOU

m0nk3yz
Mar 13, 2002

Behold the power of cheese!

bitprophet posted:

In its author's defense, the point of Mingus is to embrace the Django "reusable apps" philosophy. It's not that they're plugins to some core app, it's that the core app is simply a tiny bit of glue to hold all of the individual components together.

So where e.g. Wordpress core implements comments, static pages, permalinks, RSS feeds, and so forth, and then has plugins, Mingus is just a collection of what its author perceives to be the best available Django comments app, permalink app, RSS feed app, etc. So to knock it for "requiring a bunch of plugins" is to miss the point of the app.

At least, that's my understanding; I haven't used it myself, only read up on it a bit. I think king_kilr has though?

You're pretty much correct - mingus is a pile of reusable apps under one banner, it doesn't implement a lot on it's own. I tend to use it piecemeal as I need for other applications. If I didn't have a ton of wordpress history, I'd be over on mingus right now personally.

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