2009-7-31

23:28 mattmcc
So /home/ryan/Projects/svn.ryankaskel.com/rkic/rkiclib/apps/thirdparty/ probably isn't on your pythonpath.
23:29 ryankaskel
it is because other code is importing it: here is the traceback: >>> from asqcom.apps.news import models
23:29 ryankaskel
Traceback (most recent call last):
23:29 ryankaskel
File "<console>", line 1, in <module>
23:29 ryankaskel
File "/home/ryan/Projects/svn.ryankaskel.com/clients/Emilio_Bustillo/asqcom/trunk/asqcom/../asqcom/apps/news/models.py", line 8, in <module>
23:29 ryankaskel
from rkiclib.apps.thirdparty.tagging.fields import TagField
23:29 ryankaskel
File "/home/ryan/Projects/svn.ryankaskel.com/rkic/rkiclib/apps/thirdparty/tagging/__init__.py", line 3, in <module>
23:29 ryankaskel
from tagging.managers import ModelTaggedItemManager, TagDescriptor
23:29 ryankaskel
ImportError: No module named tagging.managers
23:29 mattmcc
Dude, pastebin.
23:29 ryankaskel
i'm sorry I don't know if that's not allowed here
23:29 ryankaskel
sorry
23:30 mattmcc
Well, first things first, stop doing that: from rkiclib.apps.thirdparty.tagging.fields import TagField
23:30 ryankaskel
why is that?
23:30 mattmcc
The app, like any reusable app, is meant to be installed directly on the pythonpath.
23:32 ryankaskel
i understand that but is that really the only solution? doesn't Python work its way "up" in scanning for imports
23:32 ryankaskel
okay so do you have a third party type of element in your repository?
23:33 ryankaskel
and if so how you personally manage "externals"? I think we've actually had this talk before but I'm trying to implement this and i'm failing there
23:33 mattmcc
I still have a few projects left on subversion that haven't been moved to git yet.
23:33 edw
I'm gettting the following error <http://pastebin.org/5653> with a fresh Django 1.1 project with nothing but the database info (sqlite3/projname.sqlite) changed in the settings.py file.
23:34 unomystEz
What method should I use to simply return a 200 without necessarily returning any HTML?
23:34 mattmcc
unomystEz: return HttpResponse()
23:34 unomystEz
mattmcc: thanks
23:35 spike
so this doesn't make any sense to me. if you create the field as DateTimeField it creates it as a datetime.datetime object
23:35 spike
which has a fromtimestamp() method
23:35 spike
so why isn't django just calling that before inserting it? because it doesn't recognize/expect it as a timestamp?
23:36 mattmcc
Because it wasn't written that way?
23:37 spike
I guess yeah
23:37 mattmcc
That would also introduce portability issues, since a timestamp doesn't mean the same thing everywhere.
23:38 unomystEz
mattmcc: ok, so 200 for OK status, what is best to use for failed?
23:38 unomystEz
mattmcc: instead of 500 and 404
23:38 unomystEz
this is for an API and the view is to update a value in the db
23:38 mattmcc
unomystEz: That would depend on the kind of failure you want to report.
23:38 unomystEz
something not too negative. just that I received it but it didn't work.
23:39 unomystEz
maybe I sould refer to an RFC here
23:39 mattmcc
Probably.
23:39 mattmcc
"Doesn't work" is quite a last resort in error reporting.. :)
23:40 unomystEz
heh, true
23:40 unomystEz
maybe I'll just log it with logging and return 200 anyway
23:41 mandric
if i'm copying an object like bill = bob; bill=None; bill.save() ... how do i save the manytomany relationshiops again?
23:44 krunktar
is there a way to get the reverse url for a flatpage?
23:45 Navies
Does anyone know if this is still up to date-> http://code.djangoproject.com/wiki/UsingFreeCom... or if there is another page to look at if you want to modify comments
23:45 mattmcc
krunktar: No need, since flatpages are hardcoded URLs.
23:45 Navies
krunktar: .get_absolute_url works on a flatpage object.
23:46 mattmcc
Navies: It's not, and the docs now discuss customizing the contrib.comments app. http://docs.djangoproject.com/en/dev/ref/contri...
23:46 krunktar
thanks guys
23:47 Navies
mattmcc: thanks but I wasnt talking about models and stuff, but like the form itself and redirections and validations
23:48 mattmcc
Navies: Well, validation would be done in a form class, that shows how to make a custom comment form class.
23:48 mattmcc
Navies: Redirection was covered in the regular comments docs: http://docs.djangoproject.com/en/dev/ref/contri...
23:49 pedahzur
Got a head scratcher. In settings.py I have DIRNAME = os.path.abspath(os.path.dirname(__file__)), MEDIA_ROOT = os.path.join(DIRNAME, 'static/'), and MEDIA_URL = '/static/' The CSS links are being generated fine, but the links to the images (generated by the thumbnail tag in the template) are coming out as:http://localhost:8000/static//home/jkugler/programming/fss/MyProject/static/images/productimage-picture-default_jpg_85x85_q85.jpg Ideas?
23:49 Navies
mattmcc: Yeah but only for post, not for preview redirection, and the thing is when using that, the form gets totally different, that is when using {{ form }} I get to see that thing that is supposed to be hidden, that honypot thing
23:52 mattmcc
Navies: Well, I haven't done much with the comments app, but if the docs don't answer it, use the source, Luke.
23:53 Navies
mattmcc: :)
23:55 yuri_zivago
i have customized comments
23:55 yuri_zivago
witha custom form
23:55 Navies
yuri_zivago: Could I have a peek
23:55 Navies
23:56 Navies
23:56 rozwell
Navies: you know you can use a pastebin
23:56 rozwell
Navies: for text
23:57 Navies
rozwell: I know but It didnt feel necessary there
23:57 yuri_zivago
so you want customization on client side?
23:57 Navies
I guess so...
23:57 mandric
anybody know how to copy a model object?
23:57 Navies
I mean I guess I gotta change the {{ form }}
23:57 rozwell
Navies: heh, well a screenshot of code is far less helpful than just the text
23:57 Navies
rozwell: its just copied from the comments doc
23:57 Navies
its not that you need to try it out
23:58 rozwell
Navies: and yes, you can employ custom rendering here
23:58 Navies
rozwell: But okay, note taken till next time
23:58 RaceCondition
have any of the 1.2 features hit the trunk yet?
23:58 mattmcc
RaceCondition: Dude, 1.1 was, like, two days ago.
23:59 pedahzur
Does anyone have any idea why thumbnail would be generating a URL for an image that is the full absolute path on disk?
23:59 RaceCondition
mattmcc: yes, I know, but I'm trying to decide whether to keep tracking trunk or stay with 1.1
23:59 clawtros
pedahzur: your upload_to path isn't relative to your media path?
23:59 RaceCondition
pedahzur: you mean sorl-thumbnail?
23:59 rozwell
pedahzur: what are your MEDIA_ROOT, MEDIA_URL and upload_to set to?
23:59 mattmcc
RaceCondition: Well, if you're planning on putting something in production, it's generally wise to target a release.
23:59 RaceCondition
yeah, probably what clawtros said
23:59 clawtros
yessssss
Page 11 of 11   ← Previous  (1,080 total)