2009-7-2
| 21:51 | belred | sorry, when using {% url foo %} in templates, how can have FOO be a variable and not a constant? |
| 21:52 | rozwell | pm2: if you save the model instance, the height and width fields should definitely get updated |
| 21:52 | pm2 | rozwell: well... its not happening for me... |
| 21:52 | rozwell | NeoKeats: you could, but you're going to have to throw away contrib/3rd party stuff that you want to use something other than the global connection |
| 21:54 | rozwell | pm2: then you could try manually saving the file |
| 21:54 | pm2 | rozwell: let me try a few things.... |
| 21:54 | rozwell | pm2: saving the file attribute will update the image fields |
| 21:54 | rozwell | pm2: err image dimension fields |
| 21:55 | pm2 | rozwell: let me paste a snippet of my models.py file somewhere... maybe I have it setup wrong |
| 21:56 | pm2 | rozwell: http://dpaste.com/62674/ -- thumb_file is the field in question - does it look like I have it setup correctly at least? |
| 21:56 | rozwell | looks fine |
| 21:57 | SmileyChris | use CATION! |
| 21:57 | Dyresen | Why is it always late at night when you get creative at coding? |
| 21:57 | pm2 | SmileyChris: well, fixed one bug anyway ;-) |
| 21:57 | rozwell | Dyresen: who says it is |
| 21:58 | pm2 | rozwell: then I'm pretty confused here... |
| 21:58 | zephid | Dyresen: Maybe because the temperature gets under 20 |
| 21:58 | pm2 | rozwell: I'm excluding the height/width fields from the admin interface, that shouldn't make a difference, right? |
| 21:59 | Dyresen | zephid: could be, it's freaking hot here these days. |
| 21:59 | rozwell | pm2: what version of django are you using? |
| 21:59 | rozwell | pm2: and how is the field being updated? |
| 22:00 | belred | is it possible to have the {% url name %} name be a variable instead of a constant? |
| 22:00 | zephid | Dyresen: Same here, the temperature has been over 27 here in Denmark in the paste 6 days |
| 22:00 | SmileyChris | pm2: i think tehy are supposed to be strings |
| 22:00 | SmileyChris | pm2: looks like it according to source |
| 22:01 | SmileyChris | belred: nope |
| 22:01 | pm2 | rozwell: django 1.0, field is being updated from a script. Basically, my project is to allow users to upload video files. I have a cron script that runs to convert the video files to .flv format. This script also creates a thumbnail image. This script is what updates the database with the thumbnail file |
| 22:01 | rozwell | pm2: i know it's a script, i'm asking how the code actually goes about updating it |
| 22:01 | rozwell | pm2: does it use the ORM? |
| 22:02 | pm2 | rozwell: yes, I just import the django ORM |
| 22:02 | rozwell | belred: no |
| 22:04 | rozwell | pm2: it looks to be the case that this doesn't quite work right under django 1.0 |
| 22:04 | ejv | someone made a django gedit theme! sweet! |
| 22:04 | ejv | :D |
| 22:05 | SmileyChris | pm2: did you read my message? |
| 22:05 | rozwell | django has a theme? |
| 22:05 | pm2 | SmileyChris: yeah, I updated that, still have problems |
| 22:05 | synic | ejv: django has themes? |
| 22:05 | ejv | rozwell: django seems to sport the green irish colors lol http://code.djangoproject.com/wiki/gedit |
| 22:10 | pm2 | rozwell: you want a look at my script? maybe that will shed some light on it? I tried uploading the thumbnail image through the admin interface and everything was uploaded correctly... |
| 22:10 | pm2 | I mean *updated* correctly |
| 22:13 | rozwell | pm2: looking at the source i don't see the fieldfile getting saved except when it's done through a form |
| 22:13 | rozwell | pm2: this is not the case in trunk |
| 22:13 | pm2 | so I should update |
| 22:13 | pm2 | ? |
| 22:13 | rozwell | that's one possibility |
| 22:13 | rozwell | or you could save the fieldfile data directly |
| 22:14 | rozwell | as that's what updates the dimension fields |
| 22:18 | pm2 | rozwell: so just calculate the height/width manually and save it manually? |
| 22:21 | kiloecho7_ | Does anyone know how to force a {% blocktrans %} tag to do a specific language besides LANGUAGE_CODE only for one blocktrans? Here's what I have already http://codepad.org/dwIFNuv4, it would be cool if I could get what's at the bottom. |
| 22:26 | rozwell | pm2: no |
| 22:27 | rozwell | pm2: model_instance.my_image_field.save() |
| 22:28 | pm2 | rozwell: ah - i see - I'll give that a try |
| 22:28 | SmileyChris | wouldn't model_instance.my_image_field.update_dimension_fields() then model_instance.save() be enough? |
| 22:28 | SmileyChris | assuming that's not a trunkism |
| 22:30 | rozwell | well that's a trunkism |
| 22:31 | benc1 | when using @login_required does it affect all the views in views.py ? |
| 22:31 | rozwell | benc1: if it's been applied to all the views in a views.py |
| 22:31 | gasull | Hi all. I'm trying to fix this problem with Apache and python-eggs: http://jjinux.blogspot.com/2008/10/python-permi... If I create a new user, how do I make my app work as that user? Thank you. |
| 22:31 | benc1 | rozwell: in the docs there is an example for using it outside of the view function. |
| 22:32 | rozwell | benc1: and what does it say about it there? |
| 22:32 | benc1 | rozwell: can't see anything. |
| 22:33 | rozwell | benc1: then what's the problem? |
| 22:33 | benc1 | rozwell: when using login_required they are putting it inside the function but when using @login_required the put it outside |
| 22:33 | rozwell | benc1: i don't think they ever put it "inside the function" |
| 22:33 | benc1 | rozwell: I want to limit access for all the functions in my views.py |
| 22:33 | rozwell | benc1: are you talking about the 2.4 decorator syntax differences? |
| 22:34 | rozwell | benc1: then apply login_required to all of them, or write a middleware |
| 22:34 | benc1 | rozwell: how do I apply @login_required to all of them? |
| 22:35 | rozwell | benc1: you put that in front of each view function definition |
| 22:35 | benc1 | rozwell: so here it will only affect my_view ? http://dpaste.com/62680/ |
| 22:35 | rozwell | benc1: yes |
| 22:35 | benc1 | rozwell: thanks |
| 22:42 | Zitter | sorry, what can I do if I haven't /media/ dir. I've entered in admin cpanel but it is not styled |
| 22:47 | juanefren | When I attempt to access any url I get this error : |
| 22:47 | juanefren | Caught an exception while rendering: bad marshal data |
| 22:47 | juanefren | What could It be ? (I'm not sure what it means) |
| 22:59 | multigl | I'm trying to deploy new django project as a fastcgi module and I've never seen this error before trying to start the server (I have 13 other projects deployed in exactly the same fashion) |
| 22:59 | multigl | |
| 23:15 | brett | I'm running a custom update query in my model object. However, when I self.save() the value gets overwritten with what's on self already |
| 23:15 | brett | E.g. I'm doing "update bar set val1=2" |
| 23:15 | brett | self.val1 is 3 |
| 23:16 | brett | doing a self.save() results in 3 being written to the database |
| 23:16 | brett | Is there some way I can tell my model object to refresh itself? Or not to update self.val1 in the db? |
| 23:16 | aonweb | brett use commit=false during save |
| 23:17 | aonweb | that will update the object in mem but not in db |
| 23:17 | brett | ahh then the next save() will write everything correctly? |
| 23:17 | brett | Does the orm just update columns that have changed? Or everything in a row? |
| 23:21 | aonweb | §check it out , i am not sure. but i think whole table use django-debug-toolbar to see which queries get exec'd or use shell |
| 23:23 | benc1 | when I delete a class from models.py of my app I get "cannot import name ClassName" |
| 23:23 | benc1 | something related to __init__.py in autodiscover line 40 |
| 23:23 | benc1 | How can I fix it? |
| 23:25 | pm2 | I want to be able to upload files with a size of several hundred MB to my django app. Is this possible using django's development server? |
| 23:26 | rozwell | pm2: yes |
| 23:26 | rozwell | pm2: serving them is a different story |
| 23:26 | pm2 | rozwell: Yeah - I serve them from an apache server, I'm just having some trouble uploading files of that size |
| 23:28 | aonweb | @brett, i meant whole row.. |
| 23:29 | benc1 | anyone familiar with "cannot import name ClassName" in /pinax-env/lib/python2.6/site-packages/Django-1.0.2_final-py2.6.egg/django/contrib/admin/__init__.py in autodiscover, line 40 ? |
| 23:29 | benc1 | I have a ClassName in my models.py. I don't need it any more but when I remove it I get the error |
| 23:32 | vIkSiT | hi all |