2008-8-31
| 23:12 | Magus- | no |
| 23:12 | Magus- | you can do things like it though, using choices on a model field |
| 23:12 | suitcase-sensiti | Magus: I want to set the initial= value of a form field, derived from an object instance a pass into the one way or another - the question is which is possible for doing that when you use custom forms |
| 23:13 | zwnj | Magus-: won't using CharField with choices make the lookup significantly slower? |
| 23:13 | Newmaniese | suitcase-sensiti: I am not really understanding what you are saying when you catch __init__(self, *args, **kwargs): you get all of the items passed to the form |
| 23:13 | suitcase-sensiti | into the form one way... (I always forget words) |
| 23:13 | Magus- | zwnj: nobody said you have to use a CharField |
| 23:13 | Magus- | IntegerField supports it too |
| 23:13 | Newmaniese | suitcase-sensiti: just then call super(YourForm, self).__init__(*args, **kwargs) |
| 23:14 | Magus- | suitcase-sensiti: so set that in the form's initial arg, not the field... |
| 23:14 | Magus- | or use self.fields['foo'].initial in __init__ |
| 23:14 | Magus- | you do not need a custom field in this |
| 23:15 | osmosis | Magus-: ahhh! found it |
| 23:15 | zwnj | Magus-: right. thanks. probably you should add an example with IntegerField to the documentation as well. |
| 23:16 | srik | Magus: No, trying that now...thx |
| 23:18 | osmosis | yah, it wasnt in my TEMPLATE_CONTEXT_PROCESSORS |
| 23:21 | jsoft | Say I have a URLField for example. How do I check a string to see if it is a valid looking URL ? |
| 23:21 | mattmcc | Validation is typically done with a form.. |
| 23:22 | mattmcc | URLField, for example, has a regex |
| 23:24 | suitcase-sensiti | thanks, folks! to use the problem that 'self' is a name only in __init__ to one's advantage saved it, I think (the self.fields[...].initial thingy) |
| 23:25 | suitcase-sensiti | it turned out that that was my actual problem, i.e., 'self' not being known where you play with the indivial form fields and widget, i.e., outside the functions of the form |
| 23:27 | technika | hi guys looking for a django job in scotland |
| 23:32 | grigora | Could someone please tell me what the following code does - widget=forms.TextInput(attrs=dict(attrs_dict, maxlength=75), specifically attrs and attrs_dict |
| 23:33 | mattmcc | Well, dict() makes a dict from its arguments. |
| 23:34 | Evanlec | hmm, is there a way to sort of 'refresh' django without having to restart apache |
| 23:34 | [530]_ | Evanlec: with mod_python , no |
| 23:35 | grigora | mattmcc: ok, so why do i get an error saying attrs_dict isn't defined? |
| 23:35 | [530]_ | Evanlec: you got MaxRequestsPerChild 1 , but that won't work in production |
| 23:36 | grigora | mattmcc: never mind, I found it |
| 23:36 | mini-man | is there somewhere where the comments contrib addon in django 1.0b2 is documented? |
| 23:36 | [530]_ | Evanlec: i would suggest mod_wsgi and deamonize |
| 23:38 | Evanlec | [530]_: i just got mod_wsgi running, but ive no idea how to do that |
| 23:38 | grigora | what does the underscore do in this code? - label=_(u'password') |
| 23:39 | kratorius | grigora: marks that string for translation |
| 23:40 | jsoft | mattmcc: Yes but is there some kind of function in each datatype, ie, foo = SomeField, foo.validate(test_string) ? |
| 23:40 | grigora | kratorius: what does that mean exactly? I am getting an error saying - name '_' is not defined |
| 23:42 | kratorius | grigora: add "from django.utils.translation import ugettext_lazy as _" |
| 23:42 | kratorius | at the beginning of the file |
| 23:42 | grigora | kratorius: ah, thank you |
| 23:42 | [530]_ | Evanlec: if running as a specific user, just log in as that user and run killall httpd |
| 23:43 | mattmcc | jsoft: Fields have a clean method. |
| 23:43 | Evanlec | [530]_: okay... |
| 23:43 | zwnj | should i set get_manipulator_field_objs() for my customized fields if i use newforms_admin? |
| 23:43 | zwnj | ^set^def |
| 23:43 | Evanlec | [530]_: but what does that accomplish? |
| 23:44 | Evanlec | [530]_: im not sure how its being run, i assume by my user, this is on webfaction |
| 23:44 | [530]_ | Evanlec: reloads the code, but olny if the processes run as that user |
| 23:46 | Evanlec | hm k |
| 23:46 | Evanlec | seems to not be permitted =\ |
| 23:47 | Evanlec | lol |
| 23:47 | Evanlec | doing that tried to kill all httpd processes for every other user on this server ;p |
| 23:48 | ericholscher | where does my sqlite db get stored on disk when django makes it? |
| 23:48 | mattmcc | Where you tell it to. |
| 23:48 | girasquid | ericholscher: wherever you tell it to in your settings.py file |
| 23:48 | seemant points | |
| 23:48 | seemant | somewhere there |
| 23:48 | ericholscher | ohh i see |
| 23:49 | jhannah | ooo... that's slick: {{event.created|date:"Y/m/d H:i:s"}} |
| 23:49 | [530]_ | Evanlec: i got the luxury of my own server ) |
| 23:49 | [530]_ | ;) |
| 23:51 | mattrussell | with the new filestorage system, how does one customize the filename of an uploaded file? e.g to prepend the logged in username? |
| 23:53 | AphelionZ | I'm trying to create custom admin_views and im spacing on where to get admin_views from.. i get the ViewDoesNotExist: Could not import tat.bloodcenter.admin_views. Error was: No module named admin_views error |
| 23:54 | Evanlec | [530]_: that is nice ;p |
| 23:54 | [530]_ | mattrussell: that is nor possible withot a custom view |
| 23:55 | [530]_ | not |
| 23:55 | ricsmo | Howdy all. I'm pretty new to django and have been looking for a good tutorial on pagination. I looked at the docs and searched google, but mostly found code snippets and not really a good explanation of how the built-in pagination works. Any resources? |
| 23:55 | HenrikV | hmm, can't seem to clear out my postgres db. Worked fine on sqlite :( auth & contenttypes refuse to be reset because of dependencies. Any postgres specific tricks ? |
| 23:55 | mattrussell | actually, i've found the solution now - upload_to can accept callable |
| 23:56 | [530]_ | mattrussell: but only if that field was changed on uplod |
| 23:58 | grigora | in the profile_callback function, how do I access the form variables? is the function even supposed to save the extra data, or just create an empty profile? |
| 23:59 | srik | forms CharField(price) with multi widget(TextInput and Select) returns a string ? When saved in CharField ... it saves as [u'123', u'free'], and if I use price[1] it saves only u but I expect it to save free ..wat am I doing wrong here or do I need to process string manually ? |
Page 17 of 17
← Previous
(1,671 total)