|
I've been trying to figure this out for a little bit, and I think I'm confused. I'm trying to build a survey form. You know, the kind where it asks you questions and you fill in a circle for "Strongly Agree", "Agree," "Disagree", etc. My model has each of those in an int field with a choices enum. Now, the thing works fine. About an hour of coding, most of that typing all the questions into the verbose names, and it's done. However, the widgets look like crap. The standard RadioSelect outputs as lists. No problem, right? I just wrote a custom renderer. code:
edit: I just blanked the strings in the enum structure. I don't know if this is the "right" way to do this, but it works. Larry Horseplay fucked around with this message at 22:44 on May 7, 2008 |
# ¿ May 7, 2008 21:44 |
|
|
# ¿ Apr 30, 2024 07:39 |
|
Yep, that's exactly how it looks. And it works! I think it's a testament to how good Django is that whenever I have to do anything somewhat "manually" I wonder if I'm doing it right.
|
# ¿ May 8, 2008 13:01 |
|
Strangely enough, I happen to work for a non-profit where accessibility is an issue. Eventually I'll have to create a subclass and render it myself, I guess. But for now I'll get the thing working. I'm using the reportlab python package to make PDFs right now as part of the package, actually. It's pretty cool
|
# ¿ May 8, 2008 20:25 |
|
Anyone have any Django-based calendaring code they wouldn't mind sharing? It seems like a common use, but I don't see much sample code via Google. (If no one's got any, though, I'll post what I have once I finish it up.)
|
# ¿ May 21, 2008 17:16 |
|
Wulfeh posted:http://www.djangosnippets.org/tags/calendar/ One of those is exactly what I needed. It even works with the models I've already created! I totally forgot about djangosnippets, too (doh!) Thanks!
|
# ¿ May 21, 2008 19:23 |
|
I'm writing a survey application. For items that have multiple checkbox entries (i.e. pick as many choices as you want), I was thinking of using a CommaSeparatedIntegerField in my model, and a MultipleChoiceCheckbox in the form. Is the the "right" way to do this?
|
# ¿ Oct 29, 2008 20:11 |
|
|
# ¿ Apr 30, 2024 07:39 |
|
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. Congrats! Most likely I'll just be exporting stuff to XLS sheets for people in my organization to play with for now, so I don't think the comma separated integers will be an issue. Thanks!
|
# ¿ Oct 30, 2008 22:22 |