2008-8-16
| 22:47 | Magus- | not a string |
| 22:47 | Magus- | so 'Enquiry' = wrong |
| 22:47 | DaveyJoe | ok |
| 22:47 | DaveyJoe | thanks |
| 22:48 | smcoll | are there any default tags that take arguments that can be either a variable from context, or a string, like a slug? |
| 22:49 | Magus- | um, almost all of them? |
| 22:49 | smcoll | for instance? |
| 22:49 | ilogik | i've got a model Post with an image field (image), and in the python shell, post_instance.image returns the path of the image as a unicode. shouldn't it be an object? |
| 22:49 | Magus- | smcoll: pick one |
| 22:50 | smcoll | firstof |
| 22:50 | Magus- | that one doesn't make sense replacing the vars with strings |
| 22:50 | Magus- | so even if it worked (which it might) it'd be silly |
| 22:50 | smcoll | which one does? |
| 22:51 | Magus- | almost all of them |
| 22:51 | Magus- | cycle, ifequal, include, probably now, with, and so on |
| 22:52 | Magus- | why are you asking this silly question anyway? |
| 22:52 | smcoll | how can i modify http://dpaste.com/71903/ to do that? |
| 22:52 | smcoll | right now it only takes a string, and can't take a variable |
| 22:52 | smcoll | the first argument of the tag |
| 22:53 | Magus- | you read the docs of course |
| 22:53 | smcoll | specifically what part of what doc |
| 22:53 | Magus- | |
| 22:53 | Magus- | the one about passing variables to a tag |
| 22:53 | Magus- | imagine that |
| 22:54 | smcoll | do i nest two try:except staments, to take care of both cases? |
| 22:55 | Magus- | what cases? |
| 22:55 | Magus- | if one throws an exception the other can't... |
| 22:55 | Magus- | so if you somehow think you'd need two excepts for two errors, no... |
| 22:55 | smcoll | well, whether i send a slug or a variable from context |
| 22:55 | Magus- | resolve_variable should handle both |
| 22:55 | smcoll | oh |
| 22:56 | nick125 | Do Generic Views use RequestContext or just normal Context? |
| 22:59 | Magus- | nick125: RequestContext |
| 22:59 | nick125 | Magus-: Awesome. Thanks |
| 23:06 | chrisptzr | How to I tell my django project to look at local_settings.py instead of settings.py? |
| 23:07 | ilogik | you can run the devserver adding a --settings=filename.py parameter to manage.py |
| 23:07 | ilogik | but i'm not sure how to configure your production server |
| 23:07 | jinzo | not only devserver, but everything that manage.py can do |
| 23:08 | nick125 | Is there a way in templates to grab the first object out of a list? |
| 23:08 | DaveyJoe | Anybody know if the latest version of django-evolution is compatible 1.0b1? |
| 23:08 | jinzo | production server setting depends on the method of deployment, on mod_wsgi it's easy as hell. |
| 23:09 | ilogik | nick125: {{ value|first }} |
| 23:09 | nick125 | ilogik: Here's where it gets fun...I need to access an attribute within the first object too. Any ideas on that? |
| 23:10 | ilogik | nope...maybe in a for loop and use if forloop.first? but that's pretty ugly |
| 23:11 | nick125 | I just need to get a single object in a generic view (the latest post), so I'm trying an archive_index view with a num_latest of 1 |
| 23:12 | nick125 | I really don't want to iterate over it, even though I know there should only be a single object...mainly because that's really ugly |
| 23:13 | nick125 | (and very prone to break if say, it happens to pass more than one object) |
| 23:13 | ilogik | if you use if forloop.first it shouldn't break |
| 23:24 | alperkanat | i'm trying to install my django app to a production server... i'm stuck in the SetEnv line... should i write the path to the settings file of the project or..? |
| 23:27 | FlorentV | Hi all |
| 23:27 | Matro | I currently have an admin-administered model, Photo, that lets up upload a single image and assign it any number of existing (or new) instances of a Tag model. I want to create an admin page that will let me upload a zip file, decompress it, and then show me a table of images on the left and tag selectboxes on the right. I'm pretty sure this is just the sort of customization that newforms-admin is designed for, but I can't figure out how to |
| 23:27 | Matro | any suggestions? |
| 23:27 | FlorentV | I have a noob-level question |
| 23:28 | Matro | yes? |
| 23:30 | FlorentV | I'm building a rather small website with different types of content: some very specific content (a list of artists, a list of expositions with lots of metadata, etc.), and some more classical like some «static» pages and news. |
| 23:30 | FlorentV | And I was wondering wether I should put it all in one single application, or create several applications. |
| 23:32 | Magus- | up to you, FlorentV |
| 23:33 | Matro | FlorentV multiple apps |
| 23:33 | Matro | FlorentV technically, of course, Magus is right (he usually is) |
| 23:34 | Matro | FlorentV: but if you're asking the question, it suggests you're new to web coding in general, and so you should probably stick to "Best Practices" -- the suggested "right" way of doing things, and that means one app -- one use |
| 23:34 | FlorentV | Magus- and Matro: let's say I may want to link news items to some exhibitions, or the other way round. If i put news in one app, and exhibitions in another one, that may be more difficult? |
| 23:35 | Magus- | no |
| 23:35 | cheshair | hi all, i am experiencing some difficulties with django.views.generic.create_update. if i use {{ form.address }} in my template object_form.html i got a proper form field in my web page, if i use {{ form.as_table }} i don't get anything. i wish i could use ":as_table" to get all the fields at once. what am i missing? |
| 23:35 | Matro | definitely not |
| 23:36 | FlorentV | Great. So several apps it is. :) |
| 23:36 | Matro | :) |
| 23:36 | Magus- | cheshair: if you're not using a very recent svn, your generics use oldforms, so its impossible to use newforms shortcuts on it |
| 23:38 | Matro | um, could someone go to www.adosphotography.com and tell me if they get a Google Analytics overlay? |
| 23:39 | mozirev | I don't |
| 23:39 | Matro | good |
| 23:39 | Matro | I have no idea why I do |
| 23:39 | Matro | must be google trying to be slick again |
| 23:40 | cheshair | Magus-: that's veeery interesting (i'm using 0.97something), no problem to update (i'm a brave boy :-)), but sounds weird because if i use modelforms within the same django installation, i can successfully use as_table... |
| 23:40 | FlorentV | Matro: I went there and saw nothing that I would describe as a “Google Analytics overlay”. |
| 23:40 | Magus- | because modelforms are newforms, obviouslyu, cheshair |
| 23:40 | Magus- | and the older generics DID NOT USE THEM |
| 23:40 | Magus- | they used OLDFORMS |
| 23:40 | Magus- | which does not have those shortcuts |
| 23:40 | cheshair | Magus-: that's so clear! |
| 23:40 | Magus- | so you're simply on too old a version of django |
| 23:41 | cheshair | Magus-: i'll update and come back here |
| 23:41 | cheshair | Magus-: thanks! |
| 23:41 | Matro | FlorentV thanks. Definitely google trying to be clever, then (must still be signed in or something) |
| 23:41 | mozirev | I just synced to the latest svn revision for testing, and my flatpages aren't working anymore. If I try to access a flatpage, it's an HTTP 302 redirect to the site's front page. Google not turning up anything useful so far. |
| 23:42 | mozirev | Last time I synced was way back in April |
| 23:45 | FlorentV | mozirev: if I used the old admin application and just updated to 1.0b1 or SVN, you may be up for a little surprise... |
| 23:46 | FlorentV | since the whole admin application changed, and the way to configure it changed as well |
| 23:47 | mozirev | right, originally the site wouldn't display and I updated my models with some admin.ModelAdmin classes |
| 23:47 | mozirev | and that got the site back |
| 23:48 | FlorentV | mozirev: for the flatpages, apparently you need to add django.contrib.sites to your INSTALLED_APPS |
| 23:49 | Magus- | you've always needed that |
| 23:50 | mozirev | I have the middleware and the installed_apps correct according to the Django Flatpages doc |
| 23:50 | FlorentV | Magus-: oh, maybe, i just checked the documentation pages for both dev and 0.96, and that was the main difference I noticed |
| 23:52 | mozirev | does newforms-admin affect flatpages' operation? |
| 23:52 | Magus- | no |
| 23:56 | mykdzn | hey what's up everyone |
| 23:56 | mykdzn | woops wrong room |
| 23:56 | mykdzn | ! |
| 23:56 | mykdzn | thought i was in geodjango |
| 23:57 | mozirev | hmm, I'll look some more |
Page 27 of 27
← Previous
(2,700 total)