Re: XML serialization and Unicode

2009-07-29 Thread l5x
Hello, On 29 Lip, 15:56, cootetom wrote: > To add, something just popped into my head. Have you got > DEFAULT_CHARSET = 'utf-8' in your settings.py fiile It didn't help. > On Jul 29, 2:51 pm, cootetom wrote: > > > I would imagine that the deserialize

XML serialization and Unicode

2009-07-29 Thread l5x
Hello, first of all, congratulations! I have a problem. When trying to open template I get following error: Original Traceback (most recent call last): File "/usr/lib/python2.5/site-packages/django/template/debug.py", line 71, in render_node result = node.render(context) File

Re: Connection.has no attribute ping -- after recompiling modpython

2008-06-19 Thread l5x
On Jun 19, 8:22 pm, l5x <[EMAIL PROTECTED]> wrote: > Hello, > > Request Method:         GET > Request URL:    https://age86.internetdsl.tpnet.pl/ > Exception Type:         AttributeError > Exception Value:        'Connection' object has no attribute 'ping' > Exceptio

Connection.has no attribute ping -- after recompiling modpython

2008-06-19 Thread l5x
Hello, Request Method: GET Request URL:https://age86.internetdsl.tpnet.pl/ Exception Type: AttributeError Exception Value:'Connection' object has no attribute 'ping' Exception Location: /usr/django/django/db/backends/mysql/base.py in _valid_connection, line 162

Re: Inserting a date into DateField

2008-01-12 Thread l5x
On Jan 12, 1:49 pm, Darthmahon <[EMAIL PROTECTED]> wrote: > Hi, > > I'm trying to insert a simple date (2002-01-12) from a form I have > created into a DateField but I keep getting this error: > > 'str' object has no attribute 'strftime' > > This is how the DateField is setup in my models.py

Re: Adding a request.user to a ModelForm instance

2008-01-08 Thread l5x
On Jan 8, 3:03 am, Car <[EMAIL PROTECTED]> wrote: > Hello > > I have following code; > > class PlaceForm(ModelForm): > class Meta: > model = Place > exclude = ('useradd',) #excluded, because form shouldn't give > a way to set user manually > > Model Place has one foreign key

Re: passing data to view using httpresponseredirect

2008-01-03 Thread l5x
Why don't you use sessions? http://www.djangoproject.com/documentation/sessions/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Syntax Error (line out of range), get_callable, urlresolvers

2007-12-30 Thread l5x
On Dec 31, 12:19 am, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > Is 534 one past the last line of views.py? Yes. > I expect you have a syntax error > such as a missing closing paren or bracket in your views.py file, which is > causing the parser to keep scanning until it reaches the end of the

Syntax Error (line out of range), get_callable, urlresolvers

2007-12-30 Thread l5x
Hello, I get the following error: Django Version: 0.97-pre-SVN-6976 Python Version: 2.5.1 Exception Type: SyntaxError Exception Value:invalid syntax (views.py, line 534) Exception Location: /home/user/django_src/django/core/urlresolvers.py in get_callable, line 47

Re: hide fields using newforms

2007-12-30 Thread l5x
On Dec 30, 5:04 pm, Florian Lindner <[EMAIL PROTECTED]> wrote: > Hello, > using newforms how can I set fields to be hidden (the hidden="hidden" > attribute)? Did you mean type="hidden" ? http://www.djangoproject.com/documentation/newforms/#widgets You can create your own widget if you need to.

Re: ModelForm, ImageField and User

2007-12-28 Thread l5x
On Dec 27, 8:22 am, Muchanic <[EMAIL PROTECTED]> wrote: > Just FYI and for anyone else who comes across this thread - I had the > same problem, trying to pass a ForeignKey via HiddenInput in an app > I'm working on. If you need to/want to do it this way, the trick is > that you have to use a

Re: Customizing date field of form

2007-12-25 Thread l5x
Maybe you should take a look at render(): http://code.djangoproject.com/browser/django/trunk/django/newforms/widgets.py#L44 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

Re: Page not showing correct data

2007-12-25 Thread l5x
After reloading the page (f5) browser shows new data? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this

Re: editing an image with ModelForm

2007-12-25 Thread l5x
Hm, I didn't have this error with my PhotoForm. You can look at it here: http://groups.google.com/group/django-users/browse_thread/thread/6693f3294e710eab --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django

Re: ModelForm, ImageField and User

2007-12-25 Thread l5x
Thank you, I will check that. I wasn't aware of that possibility. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To

Re: Using extjs with ModelForms

2007-12-24 Thread l5x
Do you want to change the HTML output of the form? Then you should take a look at render() http://code.djangoproject.com/browser/django/trunk/django/newforms/widgets.py or _html_output() with as_* http://code.djangoproject.com/browser/django/trunk/django/newforms/forms.py Best regards, l.

ModelForm, ImageField and User

2007-12-23 Thread l5x
class Photo(models.Model): user = models.ForeignKey(User) main = models.BooleanField(_('Is main?')) icon = models.ImageField(_('Icon'), upload_to='photo', null=True, blank=True, help_text=_('Don\'t touch! It will be generated automatically')) medium =

Re: 'User' object has no attribute 'get'

2007-12-23 Thread l5x
I think I missed: http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges#ModelFormsconstructornowmatchesForms That should be the solution! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users"

'User' object has no attribute 'get'

2007-12-23 Thread l5x
Traceback: File "/home/user/django_src/django/template/debug.py" in render_node 71. result = node.render(context) File "/home/user/django_src/django/template/debug.py" in render 87. output = force_unicode(self.filter_expression.resolve(context)) File

Re: Time.sleep & HttpResponse

2007-12-17 Thread l5x
"I propose to design and implement an API to make Comet behavior available to Django applications." http://hosted.corp.it/django/full.html --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post

Re: Time.sleep & HttpResponse

2007-12-16 Thread l5x
If you put /print "hello"/, the server should print it with given delay (on the server side). I think that you should use JS/AJAX to update the page after it is sent to the user (script on the user side). --~--~-~--~~~---~--~~ You received this message because you

Re: newforms: drop down datefield

2007-12-16 Thread l5x
Thank you Luis! I hope that internationalization will replace English months :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: newforms: drop down datefield

2007-12-15 Thread l5x
Look here, I have similar problem, but unfortunately nobody was able to help me. I'm still waiting for answer, because it's important for me. http://groups.google.com/group/django-users/browse_thread/thread/d3b03b7fc5288ae0 Maybe it will iluminate you somehow :)

Re: MultiWidget, value_from_datadict, SplitDateWidget

2007-12-14 Thread l5x
No problem, just waiting for somebody more advanced than me to help me:) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To

Re: Error: list index out of range

2007-12-13 Thread l5x
Can you give us "class RegistrationProfile" from C:\Python25\Lib\site- packages\registration\models.py ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Error: list index out of range

2007-12-13 Thread l5x
Traceback? Template variables? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to

Re: MultiWidget, value_from_datadict, SplitDateWidget

2007-12-13 Thread l5x
> Doesn't Django have something very similar inbuilt to newforms? You mean: SplitDateTimeWidget But there is no custom 'value_from_datadict' See: http://code.djangoproject.com/browser/django/trunk/django/newforms/widgets.py#L459 --~--~-~--~~~---~--~~ You received

MultiWidget, value_from_datadict, SplitDateWidget

2007-12-13 Thread l5x
Hello, Based on this thread: http://groups.google.com/group/django-users/browse_thread/thread/fd450734295e450f/68d466b0d6b24eb7 I have the following code for the SplitDateWidget: class SplitDateWidget(forms.MultiWidget): def __init__(self, attrs=None): widgets =

Re: Trying to reuse models and forms

2007-12-12 Thread l5x
form_for_instance? Check: http://www.djangoproject.com/documentation/newforms/#generating-forms-for-models --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Performance of a django website

2007-12-11 Thread l5x
I think that some info about your web-server could be important. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe

Re: using FileField.delete_file to remove unused images

2007-12-11 Thread l5x
I didn't use delete_file, but if you can't solve this you can write your own code for that using signals (pre_delete or post_delete). More: http://code.djangoproject.com/wiki/Signals Anyway I'm also curious how to do that without signals. --~--~-~--~~~---~--~~ You

Re: Best way to make content in templates

2007-12-11 Thread l5x
Isn't it just putting variable into template? I don't know if I understand you correctly but for example: models.py Image(models.Model) name = CharField(...) location = ImageField(...) YourModel(models.Model) image = ForeignKey(Image) user = ForeignKey(User) (...) index.html:

Re: just starting out with django along with the tutorial - getting a type error

2007-12-11 Thread l5x
Thank you Malcolm, you are very helpful today :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this

Re: creating user and profile in just one form

2007-12-11 Thread l5x
I suppose that you should also check if the username isn't already taken. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To

Re: just starting out with django along with the tutorial - getting a type error

2007-12-11 Thread l5x
Oops, Malcolm answered first :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to

Re: just starting out with django along with the tutorial - getting a type error

2007-12-11 Thread l5x
I don't know if it could help, but anyway you should: 1) add the following line at the beggining of models.py # -*- coding: utf8 -*- 2) change the order of stuff in models, at first fields: CharField etc, then classes (Admin, Meta) and methods at the end (__unicode__ etc). 3) add after

Re: cannot import ModelForm

2007-12-11 Thread l5x
Once again, you were right Malcolm. Python was importing the old django version, so I did: python setup.py install in the trunk and now it's working. Thank you everyone for your suggestions. Ps. I'm really happy that ModelForm exists, it's very useful.

cannot import ModelForm

2007-12-10 Thread l5x
Hello, I have been working Django (mod_python or Django server as well). I have updated it to SVN 6906 (newest at this time), because I wanted to use the ModelForm, but unfortunately: Python 2.5.1 (r251:54863, Oct 5 2007, 13:36:32) [GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on

Re: parameters getting modified

2007-12-10 Thread l5x
If the example from Rajesh isn't working maybe you should do sth like that: /post// ? For example: /post/http/google.com Then join it 'http' + '://' + 'google.com' --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: Non-programmer looking to create more sophisticated site

2007-12-07 Thread l5x
I suppose that you should take a look at http://www.djangoproject.com/documentation/flatpages/ as well. It will give you the basic possibilty to manage the content, than you can extend it while learning more. Best regards, l --~--~-~--~~~---~--~~ You received

Re: mark form field as required in markup

2007-12-07 Thread l5x
You also do this like that: class CommentForm(forms.Form): name = forms.CharField( widget=forms.TextInput(attrs={'class':'special'})) url = forms.URLField() comment = forms.CharField( widget=forms.TextInput(attrs={'size':'40'})) 'class':'special' --

overriding User model list_display and fields in Admin

2007-12-07 Thread l5x
Hello, I couldn't find the information how to override the 'list_display' and 'fields' of the Django (SVN) User model in Admin interface. I need to display User altogether with his two profiles. I know that there is a get_profile(), but I want to display everything related to User in the Admin,

Re: _real_get_response: global name '_' is not defined

2007-10-22 Thread l5x
Thank you, it's working now. Now I know to look for changes on http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges every time I use svn. Best regards, l5x --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

_real_get_response: global name '_' is not defined

2007-10-22 Thread l5x
Hello, my code was working fine, until I put it on my another system. The error I get with newest SVN django version is: NameError at / global name '_' is not defined Request Method: GET Request URL:http://localhost:8000/ Exception Type: NameError Exception Value:

Re: Related Field has invalid lookup: icontains

2007-07-23 Thread l5x
Okay. It works! The missing part in my code was: Q(author__username__icontains=phrase). I couldn't find it. Thank you for your help. @Tim: I will remember to debug it that way in the future. Thanks. --~--~-~--~~~---~--~~ You received this message because you are

Related Field has invalid lookup: icontains

2007-07-23 Thread l5x
Hello, I have code for searching: news = News.objects.filter( Q(title__icontains=phrase) | Q(tags__icontains=phrase) | Q(short__icontains=phrase) | Q(content__icontains=phrase) | Q(author__icontains=phrase) | Q(source__icontains=phrase) ) News model looks like that: class

Re: forms and designers

2007-07-08 Thread l5x
Maybe it will be useful: http://groups.google.com/group/django-users/browse_thread/thread/a60038f4d0777391/a94a8e1dff4865db#a94a8e1dff4865db --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: gettatr() access to ManyToMany huuuge delay?

2007-06-27 Thread l5x
On Jun 27, 11:32 pm, grassoalvaro <[EMAIL PROTECTED]> wrote: > Here some code: > - > class TestField(models.Model): > name = models.TextField() > text = models.ManyToManyField(TextOption) > class Meta: >

Re: Attrs in models

2007-06-25 Thread l5x
If it is by design - it is ok. I thought that I just can't find information *how* to do it. Thanks for your time & effort. On Jun 25, 3:19 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Sun, 2007-06-24 at 22:49 +, l5x wrote: > > This is a great stuff and I'm really

Re: Attrs in models

2007-06-24 Thread l5x
nd you don't have to have it spread all over the code. But the point is, that I don't know if there is something which can allow to do that :) Thanks, l5x --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django

Re: Attrs in models

2007-06-24 Thread l5x
the loop: for i in self.fields: self.fields[i].widget.attrs['class'] = 'yourclassname' But what's the name of field ? i.name ? or what ? On Jun 24, 10:31 pm, l5x <[EMAIL PROTECTED]> wrote: > I think that it's a right thing for me. Thanks for yo

Re: psycopg2.ProgrammingError: relation * already exists

2007-06-24 Thread l5x
Hm.. I suppose that if you change the name of model it'll be okay. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To

Re: Attrs in models

2007-06-24 Thread l5x
I think that it's a right thing for me. Thanks for your effort. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To

Attrs in models

2007-06-24 Thread l5x
Hello, is there any possibility in django to put a widget into a model instead of creating the whole forms for each model (using widgets render)? I only need to add a css class to each field in a model... Best regards --~--~-~--~~~---~--~~ You received this