2008-3-22
| 23:30 | Cide | oh, I'm aware - I'm not changing my mind :P |
| 23:30 | axiak | Cide: and arguing doesn't write code in either of our computers :) |
| 23:30 | Cide | I was merely looking for a better way than specifying the absolute path to the permalink decorator |
| 23:30 | [530] | Cide: too bad, since debugging will really suck |
| 23:31 | Cide | [530]: why, exactly? |
| 23:31 | [530] | Cide: conflicting modules |
| 23:31 | Cide | [530]: elaborate please |
| 23:32 | [530] | import somemodule may mean two different things |
| 23:32 | Cide | yes |
| 23:33 | [530] | if somemodule already exsists |
| 23:33 | [530] | and from . is py25 only |
| 23:33 | Cide | which I'm using |
| 23:33 | Cide | I'm coding this for py25 |
| 23:34 | bryan | Does anybody not develop projects using the whole manage.py startproject routine? |
| 23:34 | Cide | so there is no issue |
| 23:34 | mattmcc | bryan: Well, startproject just copies some skeleton files.. |
| 23:34 | mikeal | i use startproject still, i don't use startapp at all anymore tho |
| 23:34 | bryan | True true. The sky is falling on my app, imports are failing all over the place. |
| 23:35 | [530] | Cide: i keep all my code 2.3 compatible, just like djagno |
| 23:35 | Cide | [530]: well, that's a decision you made |
| 23:35 | Cide | I made a different one |
| 23:35 | bryan | Like. template_utils isn't finding it's own modules. |
| 23:35 | [530] | Cide: and django |
| 23:35 | Cide | [530]: yes |
| 23:35 | mikeal | bryan: what version of Python and what kind of imports are you doing? |
| 23:36 | mikeal | and did you _not_ use startproject? |
| 23:36 | [530] | Cide: so, i would say good practice |
| 23:36 | Cide | [530]: so you're saying everything done in python past 2.3 has been useless? |
| 23:36 | toddobryan_ | http://dpaste.com/40810/ Am I missing something or should the url for largepic have the MEDIA_URL prefixed to it? |
| 23:36 | [530] | Cide: no, but keep the code portable |
| 23:36 | bryan | mikeal: 2.5.1 and nothing special. I'll load template_utils... and then I'll get an error that generic_content can't find template_utils.nodes when nodes.py is there. And no, I didn't use startproject. |
| 23:37 | [530] | Cide: someone may spring python 2.3 on you |
| 23:37 | bryan | mikeal: Only reason I'm using that as an example was that it isn't mine, so it rules out the stupid error explanation. :p |
| 23:37 | mikeal | and nodes is an object in template_utils, not a sub module |
| 23:37 | Cide | [530]: it's my dedicated server :) |
| 23:37 | thinketh | question: I have some custom logic to manipulate fields of a Model before saving it. should this logic be in the view (which calls the actual save()), or should it go into the Model? |
| 23:37 | [530] | Cide: happened to me when i needed hosting |
| 23:38 | mikeal | oh, so template_utils is installed in to Python |
| 23:38 | mikeal | it's not even part of your app |
| 23:38 | bryan | mikeal: Yep. |
| 23:38 | Cide | I made a conscious decision to use features from py24 and up, and I don't think you can argue that it's a valid decision |
| 23:38 | Cide | err, invalid |
| 23:38 | [530] | i run py2.5 dedicated too |
| 23:38 | mikeal | how did you install template_utils? |
| 23:38 | [530] | but 2.3 at work |
| 23:38 | mikeal | setuptools? |
| 23:38 | toddobryan_ | Does anybody use FileField and ImageField successfully? |
| 23:38 | Cide | py25 gives me nice stuff like... explicit relative imports |
| 23:38 | bryan | I tried both ways, installing it using distutils and just throwing it in my project directory. |
| 23:38 | [530] | mikeal: svn co :) |
| 23:39 | bryan | [530]: That. :P |
| 23:39 | Cide | py25 also has the datetime.strftime method iirc |
| 23:39 | toddobryan_ | I'm trying to use them for the first time and I'm getting a weird issue as shown in the dpaste. |
| 23:39 | [530] | or svn export |
| 23:39 | mikeal | svn co and then you ran $ python setup.py install _or_ $ python setup.py develop? |
| 23:39 | toddobryan_ | MEDIA_ROOT is defined correctly and uploaded files get saved there. |
| 23:39 | bryan | mikeal: Yep. |
| 23:39 | mikeal | drop in to a Python shell |
| 23:39 | mikeal | import tempalte_utils |
| 23:39 | mikeal | template_utils.__file__ |
| 23:40 | [530] | mikeal: no, just to a path on PYTHONPATH |
| 23:40 | bryan | It's happening everywhere in my app though. If an app has a templatetags directory that needs something from it's parent, it won't find it. |
| 23:40 | mikeal | make sure that looks right |
| 23:40 | toddobryan_ | The problem is that model.get_field_url() returns just the file path, without MEDIA_URL prefixed on the front. |
| 23:40 | bryan | [530]: I've littered my PYTHONPATH, and it still doesn't work. :/ |
| 23:40 | mikeal | ok, so sys.path might be getting mangled somewhere |
| 23:40 | mikeal | what i would do |
| 23:40 | coulix | is there a link around where i could some real use of django testing component ? |
| 23:40 | [530] | bryan: the tag is in a project? |
| 23:40 | coulix | *see some |
| 23:41 | mikeal | is drop in to a python shell and check template_utils.__file__ |
| 23:41 | mikeal | and then drop in to the django manage.py shell |
| 23:41 | mikeal | or add a debugging statement somewhere in your app before the failure |
| 23:41 | mikeal | checking the same thing |
| 23:41 | mikeal | and make sure they match |
| 23:42 | [530] | if i got shell acces i could fix anything, or a "brain-transfer" :P |
| 23:42 | mikeal | because when django starts up it does some changes to sys.path to add your apps parent directory, that could be messing something |
| 23:42 | mikeal | you can't drop in to a Python shell where you are developing this? |
| 23:43 | bryan | It's giving me errors. What's weird is that it used to work, now it doesn't. |
| 23:43 | mikeal | echo $PYTHONPATH |
| 23:43 | mikeal | is that screwed up in some way? |
| 23:43 | [530] | mikeal: noly the dev server does that, and the taglib loading |
| 23:43 | [530] | only |
| 23:43 | mikeal | also, you may wanna try python -v |
| 23:43 | bryan | I checked it through import sys, print sys.path and it looked fine. |
| 23:44 | mikeal | ok, are you two people in the same room, or are you completely different people with different problems |
| 23:44 | mikeal | i'm now officially confused |
| 23:44 | bryan | I'm sure 2 people with different problems. |
| 23:45 | mikeal | bryan: so the import is giving you errors, starting the python shell is _not_ giving you errors |
| 23:45 | bryan | Yes. |
| 23:45 | bryan | And it's only templatetag directories. :/ |
| 23:45 | mikeal | [530]: i have no idea how to debug something without access to a Python shell, sorry :( |
| 23:45 | cpengwin | Does anyone other there use Git to manage their django projects? |
| 23:46 | cpengwin | err, anyone out there... i can't type |
| 23:46 | mikeal | is there a particular reason you're adding the parent directory for tempalte_utils rather than installing in to Python? |
| 23:46 | mikeal | adding the parent to PYTHONPATH that is |
| 23:46 | bryan | It's just worked that way for me before. |
| 23:47 | [530] | cpengwin: just django, but i can probably help |
| 23:47 | bryan | But it's weird that something that should work out of the box, doesn't. |
| 23:47 | mikeal | ok, so what I do, and you don't _have_ to do things the way I do, but I use setuptools' develop mode for packages I checkout of svn repos |