2008-3-13
| 23:40 | Magus- | tesseracter: look at existing widgets - copy them |
| 23:40 | subsume | tesseracter: ? |
| 23:40 | Sunmaster_14 | mattmcc: indeed you can |
| 23:40 | samhaine | Hey! IT WORKED :) |
| 23:40 | Magus- | subsume: django tax class? |
| 23:40 | samhaine | Magus- Thank U 4:) |
| 23:41 | samhaine | help |
| 23:42 | tesseracter | subsume, im making a tag widget, just wanted some confidence before i started. i hate working on something for 10 hours, then when i have a problem, i come on IRC, and someone says "just use *, it'll be done in 2 minutes" and i /facepalm |
| 23:42 | ned | is there like a link_to functionality or shold i just use a href |
| 23:42 | subsume | tesseracter: story of my life |
| 23:42 | Magus- | ned: and link_to is...? |
| 23:42 | mattmcc | Sunmaster_14: Do you happen to have the schema for these tables handy? I'm still a bit uncertain about how the relationships are arranged, based on what you've said. |
| 23:43 | gordonjcp | Magus-: , insanekane: woot, it works |
| 23:43 | ned | magus- it's a ruby on rails convention you use for ..linking to other objects |
| 23:43 | mattmcc | ned: What's the underlying DB concept that link_to represents? |
| 23:43 | tesseracter | subsume, wisdom comes not from what problems you face, but what you learn from them. i learned to make sure im not being stupid by checking at the start :-) |
| 23:43 | insanekane | gordonjcp: good |
| 23:43 | ned | mattmcc, an object referenced i suppose? |
| 23:43 | gridlock | Magus-: a railsism |
| 23:43 | Sunmaster_14 | mattmcc: Not really. But there is a uid which is a unique identifier for each of the tables. Ideally I'd like members to have indices into both of the others. |
| 23:43 | ned | something that's inherited |
| 23:43 | Magus- | gridlock: I figured that |
| 23:43 | Magus- | but whats it do? |
| 23:43 | Sunmaster_14 | I'm aware that i can use the related_name attribute, but it's still easier for my app if it's a real field. |
| 23:43 | gridlock | makes an href |
| 23:44 | gridlock | i think |
| 23:44 | Magus- | I can't hardly present an alternative without knowing what it does :) |
| 23:44 | ned | gridlock, yep |
| 23:44 | mattmcc | ned: Model inheritence? |
| 23:44 | ned | yes |
| 23:44 | mattmcc | That's not in trunk yet. |
| 23:44 | gridlock | the alternative i think is {{ myobj.get_absolute_url }} |
| 23:44 | gordonjcp | time for a beer I think |
| 23:44 | Magus- | not quite, gridlock |
| 23:44 | Magus- | you can /make/ that an alternative |
| 23:44 | notanumber | I still can't quite figure out how to get just one image from my model. I tried this adding a new method to Project that does this return Image.objects.get(project=self.id) |
| 23:44 | notanumber | Am I completely off? |
| 23:44 | ned | mattmcc, so i should just use an a href? |
| 23:44 | Sunmaster_14 | oh, looks like onetoonefield will do it for me |
| 23:45 | subsume | tesseracter: and one day so will I |
| 23:45 | Magus- | ned: what does link_to do? |
| 23:45 | Magus- | remember, we don't do rails |
| 23:45 | ned | like if im on the artists list page and i want to go to their song page, and im linking to it, or something along that like magus- |
| 23:45 | mattmcc | Sunmaster_14: Well, the current onetoone is a bit iffy. It precludes one of the tables having a PK of its own. |
| 23:45 | Magus- | .... |
| 23:45 | Magus- | you're not explaining anything |
| 23:45 | ned | magus-, ignore the fact that i mentioned link_to okay |
| 23:45 | mattmcc | ned: Okay, that's not inheritence at all. |
| 23:45 | Magus- | do you mean, say, it generates the URL for a view/function, so that you don't have to hard-code it? |
| 23:45 | Sunmaster_14 | mattmcc: oh. which table? |
| 23:46 | Magus- | if so, just say that |
| 23:46 | Magus- | its not hard |
| 23:46 | ned | magus-, yes |
| 23:46 | Magus- | THERE we go |
| 23:46 | Magus- | |
| 23:46 | Magus- | that's one bit |
| 23:46 | Magus- | |
| 23:46 | Magus- | and that's the other, for templates |
| 23:46 | ned | oh, path.to was what i was looking for. thanks |
| 23:47 | mattmcc | Sunmaster_14: The 'target' table. But is it really a onetoone? An office only has one member? |
| 23:47 | gordonjcp | the next time someone asks me to implement something like this, I'm going to do it all in hardware |
| 23:47 | Magus- | path.to ? |
| 23:47 | Magus- | what the hell is that |
| 23:47 | Sunmaster_14 | mattmcc: it is, since uid is a unique identifier and is the same for both |
| 23:47 | Sunmaster_14 | given a uid, you can find a member and his/her committee assignments. |
| 23:48 | Sunmaster_14 | and his/her office. |
| 23:48 | mattmcc | But multiple people can be in the same office. |
| 23:48 | Sunmaster_14 | No, these are elected officials. :) |
| 23:48 | mattmcc | Ah. More sense, it is making now. :P |
| 23:49 | insanekane | Sunmaster_14: making a parliamentary information system ? |
| 23:49 | Sunmaster_14 | sort of, only it's the US. It's a legislative scorecard. |
| 23:50 | Sunmaster_14 | Storing vote data for legislators and giving them scores on issues. |
| 23:50 | insanekane | Sunmaster_14: oh you mean, you making a privately owned website discussing the proceedings ? |
| 23:50 | insanekane | Sunmaster_14: ok i get it |
| 23:50 | Sunmaster_14 | yeah, for a group called USPIRG |
| 23:51 | insanekane | that cool. im making a PIS too ... only its for my state's legislative assembly ... and it uses RDF/Sparql |
| 23:51 | Sunmaster_14 | what state? |
| 23:52 | Sunmaster_14 | what are RDF and Sparql? |
| 23:52 | insanekane | Sunmaster_14: the state of Kerala, in India :) |
| 23:52 | Sunmaster_14 | ah |
| 23:52 | mattmcc | insanekane: So the ORM is useless for you.. :) |
| 23:52 | subsume | isn't India a state? |
| 23:52 | insanekane | mattmcc: not at all ... im doing a ton of other projects ... most of which I like and use the django ORM. (but for some, the ORM is pretty retarded) |
| 23:53 | mattmcc | insanekane: Well, for RDF is doesn't make much sense. |
| 23:53 | insanekane | subsume: well .... |
| 23:53 | subsume | =) |
| 23:53 | insanekane | mattmcc: yeah it doesnt |
| 23:57 | subsume | so i've got 'django.core.context_processors.request', in my settings and {{ request.method }} in my template. Why why why does it not show anything? |
| 23:57 | subsume | the auth context_processor magically works. |
| 23:58 | insanekane | subsume: are you using RequestContext along with render_to_response ? |
| 23:59 | subsume | didn't realize i had to. the auth one doesn't require anything additional |
| 23:59 | insanekane | subsume: if you arent, then context processors wont work |
| 23:59 | mattmcc | subsume: The magic is that generic views use RequestContext by default. |
| 23:59 | insanekane | subsume: you should be using direct_to_template instead of render_to_response ... it handles the request context stuff for you automatically |
| 23:59 | mattmcc | subsume: render_to_response doesn't. |
| 23:59 | insanekane | just like any other generic view |
Page 31 of 31
← Previous
(3,096 total)