Re: DB migration from Oracle to MySQL
Thank you for your answer Ian. Then I dropped the models for which there is no id (in fact I don't need them). I also removed these apps to prevent dumpdata from trying to read the related tables (which does not exists in the source Oracle DB): 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.admin', Now its running... but I fear its going to run forever ! python.exe is occupying all the remaining 800 MB from a total 1GB physical memory. I am wondering if Python is really using the virtual memory (10GB) or not ? --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Django Development Position
Yes, me too. I am desperately seeking this kind of job offering here in southern Europe. I hope it will happen before I retire (if I am not already too old). --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Is it possible to give a verbose name to my projects ?
Hello, I can't remember if it is possible or not. Is possible to have a different name for my projects in the admin Site Management panel ? Olive. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: "Powered by Django" directory - Designer Wanted!
Ross, in fact there was an error, but it didn't catch my eyes. You should make it more visible. Nice work anyway, Olivier. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Jasper Reports
Hello, another way is to use OpenOffice: - easy to use and feature reach graphical interface (Text, Draw, Presentation or Speadsheet) - Native PDF export (you don't need any Adobe product) - standard Open Document Format (recommended way to populate data from a template using LXML for example) - PyUno API (to automate document opening and exporting) - very good performance Feel free (of charge) to ask question ;-) HTH, Olive --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: "Powered by Django" directory - Designer Wanted!
Hi Ross, I've tried to add my site but I don't know if it succeed or not. After having click on "Add site" the form displayed again without any success or failure message. Olive. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Is it a bug: f.data = data return False instead of True ?
Malcom, I don't see any bound_data attribute. Can you give me an example please ? I'm using 0.96 by the way. Olive. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Is it a bug: f.data = data return False instead of True ?
Hi, This returns True: f = myform(data) f.is_valid() while this returns False: f = myform() f.data = data f.is_valid() Is it a bug ? Olive. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: How to bind data after instantiation of a new form
Thanks Malcom. Please forgive me, it is friday and working with Django is equally entertaining and tiring. Have a good WE, Olive. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Pydev users: Undefined variable from import: objects
On 16 mai, 08:25, Margaret <[EMAIL PROTECTED]> wrote: > Undefined from import:objects > may you need to config your path. I guess yes, but how ? These directories are already in my path: django and my_project. What else ? Olive. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Pydev users: Undefined variable from import: objects
Hi, this is a question for Pydev/Django users. Do you have this problem (see subject) ? Do you know how to solve it ? Thx, Olive. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Newform and i18n
Ticket is #3877. I did not found a way to assign the ticket to you Malcom. It has been assigned to Hugo. On 30 mar, 08:53, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Fri, 2007-03-30 at 01:43 -0700, olive wrote: > > Hello, > > > Here is how I define a form in my views: > > > class MyForm(forms.Form): > > name= forms.CharField(label=_('Name')) > > ... > > > The problem is _('Name') is translated when I restart the server > > (Django or Apache), > > but not when I switch the browser locale. > > > I tried both > > from django.utils.translation import gettext_lazy as _ > > and > > from django.utils.translation import gettext as _ > > > Any idea ? > > I would hazard a guess (and I may be wrong and thus doing Adrian a > disservice) that i18n support for newforms has not been completely > though through yet. There seem to be a couple of places in the code that > need some i18n support put in. > > As a general rule, any code that is executed when a file is imported > should be using gettext_lazy as the translation function. This would > include things like the class attributes you are defining in your > example. A consequence of this is that the code which uses those strings > needs to call gettext() on the string in order to force the translation. > Right at this moment, newforms does not do the gettext call. So you > problem is not completely solvable without a bugfix in Django. > > If you could file a ticket about this and put it in the > internationalisation component -- even assign it to me (I am mtredinnick > in Trac) -- we won't forget about it and I'll make sure we get the right > hooks in the code. > > Regards, > Malcolm --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Newform and i18n
Hello, Here is how I define a form in my views: class MyForm(forms.Form): name= forms.CharField(label=_('Name')) ... The problem is _('Name') is translated when I restart the server (Django or Apache), but not when I switch the browser locale. I tried both from django.utils.translation import gettext_lazy as _ and from django.utils.translation import gettext as _ Any idea ? Olive. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: A silly question from a tired a man
OK, I need dict(request.POST)[''countries'] ! But why ? On 29 mar, 17:03, "olive" <[EMAIL PROTECTED]> wrote: > Hello, > > This is the request.POST I get from a (new)form: > ['Register'], 'countries': ['DE', 'ES']}> > > No I want to have the 'countries' list but request.POST[''countries'] > gives me 'ES' instead of the entire list. > > WHY ? > > Do I really to go home now ? > > Olivier. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
A silly question from a tired a man
Hello, This is the request.POST I get from a (new)form: No I want to have the 'countries' list but request.POST[''countries'] gives me 'ES' instead of the entire list. WHY ? Do I really to go home now ? Olivier. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: jquery integration to django?
It depends on what you mean by integrate ... I'm currently developping a Django/JQuery app and it is desperately easy. All you have to use on a django side is something like this: from django.utils.simplejson import dumps def myView(request): myQuerySet = myFunctionToBuildMyQuerySet(request.POST.copy()) json = dumps(myQuerySet) return HttpResponse(json) --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: JSON serializer and UTF-8
Thank you Patrick and Gábor, Here is my final view (tested with Django HTTP server, FireFox 2.0 and IE6.0): from django.shortcuts import HttpResponse from wabe.body.models import Section from django.utils.simplejson import dumps def loadcontent(request): post = request.POST.copy() section = Section.objects.get(pk=post['section']) contents = [] for co in section.contentsorder_set.all().iterator(): contents.append({'content': co.datacontent.content, 'type': co.datacontent.type}) json = dumps(contents, ensure_ascii=False) return HttpResponse(json, mimetype="text/json; charset=UTF-8") --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
JSON serializer and UTF-8
Hello, I'm trying to send som UTF-8 data this way: json = serializers.serialize("json", myQuerySet, ensure_ascii=False) return HttpResponse(json, mimetype="text/javascript; charset=UTF-8") But the accented characters are not displayed properly in the browser. But if I put this on the first line of my views.py: # -*- coding: UTF-8 -*- and I try to send hard coded data this way: json = '[{"pk": "1", "model": "body.datacontent", "fields": {"content": "Heading à 1", "type": "hdg"}},{"pk": "2", "model": "body.datacontent", "fields": {"content": "Para 1", "type": "par"}}]' Then "Heading à 1" is properly displayed in the browser. Question: am I using serializers.serialize the right way or is it broken ? Note: my database is UTF-8 encoded too (I have tested that by extracting an accented string from it and displaying it in the browser). Olive --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Auth and flash
This is a question you should also ask to openlaszlo.org users. Openlaszlo is a framework which helps in building rich Flash GUI in a XUL fashion. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Pydev and Django
You are right Malcolm, My project's PYTHONPATH was not set and Eclipse global one was pointing to an old Django version used by another project. Now all is OK. THX --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Pydev and Django
Fabio, I'm using Django 0.95 and the console says : manage.py: error: no such option: --noreload Do I need a fresh SVN copy ? Olivier. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Problem upgrading from 0.95 build 3085 to 3233
I have checkd out the code from scratch (now it is 3275) but the problem remains. I suspect that something is wrong in my model since 3085 but I can't figure out what. Please help ! --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Problem upgrading from 0.95 build 3085 to 3233
Hi, there is no problem using the database in place. The problem occures when I try to create the database from scratch: mysql -uroot -p%passwd% -e"drop database %database%" mysql -uroot -p%passwd% -e"create database %database%" python manage.py syncdb Creating table auth_message Creating table auth_group Creating table auth_user Creating table auth_permission Creating many-to-many tables for Group model Creating many-to-many tables for User model Creating table django_content_type Creating table django_session Creating table django_site Creating table django_admin_log Creating table application_docchunk Creating table application_screenshot Creating table application_proglanguage Creating table application_application Traceback (most recent call last): File "manage.py", line 11, in ? execute_manager(settings) File "C:\Applications\wiposoft\dev\python\django\core\management.py", line 1297, in execute_manager execute_from_command_line(action_mapping, argv) File "C:\Applications\wiposoft\dev\python\django\core\management.py", line 1221, in execute_from_command_line action_mapping[action]() File "C:\Applications\wiposoft\dev\python\django\core\management.py", line 473, in syncdb cursor.execute(statement) File "C:\Applications\wiposoft\dev\python\django\db\backends\util.py", line 12, in execute return self.cursor.execute(sql, params) File "C:\Applications\wiposoft\dev\python\django\db\backends\mysql\base.py", line 35, in execute return self.cursor.execute(sql, params) File "C:\soft\python24\Lib\site-packages\MySQLdb\cursors.py", line 137, in execute self.errorhandler(self, exc, value) File "C:\soft\python24\Lib\site-packages\MySQLdb\connections.py", line 33, in defaulterrorhandler raise errorclass, errorvalue _mysql_exceptions.OperationalError: (1005, "Can't create table '.\\wiposoftdev\\#sql-84_3e9.frm' (errno: 121)") Here is my mode: from django.db import models from django.contrib.auth.models import User from datetime import datetime class Contact(models.Model): user= models.ForeignKey(User) name= models.CharField(_('name'),maxlength=200,unique=True) def __str__(self): return self.name class Meta: verbose_name = _('author') verbose_name_plural = _('authors') ordering = ['name'] class Admin: list_display = ('name',) search_fields = ['name'] class ProgLanguage(models.Model): name= models.CharField(_('name'),maxlength=200,unique=True) def __str__(self): return self.name class Meta: verbose_name = _('programming language') verbose_name_plural = _('programming languages') ordering = ['name'] class Admin: list_display = ('name',) class OperatingSystem(models.Model): name= models.CharField(_('name'),maxlength=200,unique=True) def __str__(self): return self.name class Meta: ordering = ['name'] class Admin: list_display = ('name',) search_fields = ['name'] class Software(models.Model): name= models.CharField(_('name'),maxlength=200,unique=True) xp_compat = models.BooleanField(_('MS Windows XP compatible'),default=False) modified_on = models.DateTimeField(editable=False) short_desc = models.TextField(_('short description'),blank=True,null=True) comments= models.TextField(_('comment'),blank=True,null=True) os = models.ManyToManyField(OperatingSystem,verbose_name=_('operating system'),filter_interface=models.HORIZONTAL,blank=True,null=True) prgm_lang = models.ManyToManyField(ProgLanguage,verbose_name=_('programming language'),filter_interface=models.HORIZONTAL,blank=True,null=True) def __str__(self): return self.name def save(self): self.modified_on = datetime.now() super(Software, self).save() # Call the "real" save() method def short_description(self): return self.short_desc short_description.allow_tags = True class Meta: verbose_name = _('third party software') verbose_name_plural = _('third party software') ordering = ['name'] class Admin: list_display = ('name','short_description','modified_on') search_fields = ['name','short_desc'] list_filter = ['modified_on','xp_compat','os','prgm_lang'] fields = ( (None, {'fields': ('name','xp_compat')}), (_('Short description and comments'), { #'classes': 'collapse', 'fields' : ('short_desc','comments') }), (_('Links'), { #'classes': 'collapse', 'fields' : ('os','prgm_lang') }), ) js = ( 'js/tiny_mce/tiny_mce.js', 'js/tiny_mce/textareas.js', ) class BusinessUnit(models.Model): name=
Re: order_by in different tables
None of the documented method works for me: The only way I found to make it works (affter having suffered a lot) is: MyRelatedModel.objects.all().extra( select={'my_field': 'SELECT my_field FROM myapplication_mymodel WHERE myapplication_mymodel.id = myapplication_myrelatedmodel.mymodelfk_id'} ).order_by('my_field') Explanation: the .extra(select={'extra_field_name':'some sql join query'}) method add an extra field to the query set which can then be used to order it. HTH --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: One-to-one not to be used?
This works perfectly well for 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 unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: does django go to 11?
Hello, here is a "simple" way to achieve conditional hiding of the submit row: 1) make a copy of django\contrib\admin\templates\admin\change_form.html in your own template: location mytemplates\admin_copies\change_form.html 2) change it by wrapping submit_row in a block, for example: {% block hidesubmit %}{% submit_row %}{% endblock %} 3) create a new change_form.html template in mytemplates\admin\ to extend the admin copy: {% extends "admin_copies/change_form.html" %} {% load i18n admin_modify adminmedia %} {% block hidesavetop %} {% include "admin_lib/hidesave.html" %} {% endblock %} {% block hidesavebot %} {% include "admin_lib/hidesave.html" %} {% endblock %} 4) create mytemplates\admin_lib\hidesave.html: {% load i18n admin_modify adminmedia %} {% ifequal user.username 'admin' %} {% submit_row %} {% else %} {% if original.admin.all %} {% for a in original.admin.all %} {% ifequal user.username a.user.username %} {% submit_row %} {% endifequal %} {% endfor %} {% else %} {% submit_row %} {% endif %} {% endifequal %} Notes: - here I have only one administrator named admin. It should be possible to improve this template to make it more generic. - this also assume that the model provides an admin field which is a ManytoMany (or ForeignKey) to Django User model. Maybe there is way to detect which field is related to User model. HTH Olive. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: dojo
I use TinyMCE which is very good. There is an how-to in the Wiki at http://code.djangoproject.com/wiki/CookBookAdminTools --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Database table not found by extra lookup
Thank you very much Malcom. Olive. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Queryset depending on related objects existenz
For now I am going to use: context["app"] = [app for app in Application.objects.all() if app.docchunk_set.count() == 0] Is it really the ony solution for that problem ? Olive. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
How to hide list filter entries which will give an empty result
Hi, Here is my model: class Application(models.Model): name = models.CharField( _('application name'), maxlength=200, unique=True) group_admin = models.ForeignKey( User, verbose_name=_('administrator'), related_name="group_admin", editable=False, blank=True, null=True) admin = models.ManyToManyField( User, verbose_name=_('authors'), filter_interface=models.HORIZONTAL, blank=True, null=True) class Meta: verbose_name = _('application') verbose_name_plural = _('applications') ordering = ['name'] class Admin: list_filter = ['group_admin','admin'] In the admin list of Applications, all the existing users appears under 'administrator' and 'authors' list filters. Question: is here a way to show only the users who are effective administratrors (set as group_admin for at least on app) or authors (in others word: filter options which will give non-empty result) ? Olive --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Ecommerce & Django
+1 for python-hosting My possible contributions: - on-the-fly PDF invoice creation using ReportLab (or another PDF lib ?) - Advertising management - links with others Web Services (Amazon ...) - The Shop as Web Service ... ... --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Ecommerce & Django
I'm currently working on rewriting a store (for my wife too;) I have originaly wrote in OmniMark language (isn't it exotic ?). It is pretty straightforward with Django, I have already achieve the shopping cart management, user registration, shipping (Chronopost, France), discounts. But the model is far from generic unless you want to sell CDs, DVDs, books, music and dance events and accessories. It is not yet plugable, has not been port to Magic Removal branch (this is the next step before going on dev). I am wiilling to share my experience and participate to such a project. Olivier. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Ecommerce & Django
I'm currently working on rewriting a store (for my wife too;) I have originaly wrote in OmniMark language (isn't it exotic ?). It is pretty straightforward with Django, I have already achieve the shopping cart management, user registration, shipping (Chronopost, France), discounts. But the model is far from generic unless you want to sell CDs, DVDs, books, music and dance events and accessories. It is not yet plugable, has not been port to Magic Removal branch (this is the next step before going on dev). I am wiilling to share my experience and participate to such a project. Olivier. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Using _pre_delete() to stop execution
I totally agree with Glenn. Every day I suffer of the lack of example in the Python doc. It would be great that Django does it better. Olivier. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Showstopper: manytomany admin widget broken under IE6.0 when in collapsed group
Ticket #1621 --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Showstopper: manytomany admin widget broken under IE6.0 when in collapsed group
Hi, when your uncollapse the first time then the right list show only one entry (in fact it is a dropdown at this stage). If you save without performing any other operation before, then only the shown entry will saved in the database (others entries will be LOST !). I you move one or more entry from a list to the other then the normal widget appearance is restored and a subsequent save operation works as expected. I had another issue with the rendering of these widget in IE 6, the only dirty workaround I've found is to add a in admin/change_form.html: {% for bound_field_set in bound_field_sets %} {% if bound_field_set.name %}{{ bound_field_set.name }}{% endif %} {% if bound_field_set.description %}{{ bound_field_set.description }}{% endif %} {% for bound_field_line in bound_field_set %} {% admin_field_line bound_field_line %} {% for bound_field in bound_field_line %} {% filter_interface_script_maybe bound_field %} {% endfor %} <== {% endfor %} {% endfor %} Sorry I don't know how to post a ticket. Olivier. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Hiding Save options in admin change form based on user id
Hello Django experts, I'm trying to hack admin/change_form.html (do I need to hack the corresponding view too?) to make Save options (submit_row tag in admin/change_form.html) disappear if one of the user related to the object being saved is different than the logged in user. The problem is that I don't know how to access the list of related user objects from this template (or corresponding admin/views/main.py). Excerpt form my models: class Contact(models.Model): name= models.CharField(_('name'), maxlength=200, unique=True, core=True) user= models.ForeignKey(User, edit_inline=True, num_in_admin=1, max_num_in_admin=1, unique=True) class Application(models.Model): name= models.CharField(_('application name'),maxlength=200,unique=True) admin = models.ManyToManyField(Contact, verbose_name=_('administrator'), filter_interface=models.HORIZONTAL, blank=True, null=True) The object being saved is of class Application. I'm sitting on MR branch. Any idea please ? Olivier. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: extend User in m-r
Bryan, this won't work either, because when you try to save the user using admin you will have this kind of error: Request Method: POST Request URL:http://localhost:8000/admin/auth/user/40/ Exception Type: TypeError Exception Value:Cannot resolve keyword 'name' into field Exception Location: c:\soft\python24\lib\site-packages\django\db\models\query.py in lookup_inner, line 764 'name' being the unique property defined for my related object: name = models.CharField(_('name'),maxlength=200,unique=True,core=True) --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: OneToOneField
OK, you do, not the original poster. Anyway, I've heard that subclassing has been improved in MR. Why don't you use that instead ? --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: OneToOneField
No, an up to date svn trunk. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: OneToOneField
Strange, OneToOne works pretty well for me to extend User model (I would prefer to subclass but without having new database tables). On the contrary, I had many problem with OneToOne to extend my own model(s), I use ForeignKey with intermediary model and Inline Edit instead. hth --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Accessing a session within template context processors
Hi Ross, this is the way (simplified) I do with a generic view: Url: (r'^app/$', 'project.app.views.index'), View: --- from django.views.generic import list_detail def index(request): return list_detail.object_list(request, 'app', 'module', extra_context = {"region": request.session['region']}, paginate_by=10, allow_empty=True) Now, if your module_list.html template extends you base.html, you can use your region variable in either base.html or module_list.html. HTH Olivier --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: admin/change_form broken ?
Its OK now. Thanks Robert and Kenneth
admin/change_form broken ?
Hello, I have updated Django from svn today and this is the message I get when I try to display an item update admin page: 'block' tag with name 'extrahead' appears more than once Request Method: GET Request URL:http://127.0.0.1:8000/admin/events/events/1/ Exception Type: TemplateSyntaxError Exception Value:'block' tag with name 'extrahead' appears more than once Exception Location: C:\soft\Python24\lib\site-packages\django\core\template\loader_tags.py in do_block, line 122 Template error In template C:\soft\Python24\lib\site-packages\django\contrib\admin\templates\admin/change_form.html, error at line 80 'block' tag with name 'extrahead' appears more than once 70 71 {% endfor %} 72 {% endif %} 73 {% endif %} 74 {% endif %} 75 76 {% endblock %} 77 === 78 {% extends "admin/base_site" %} 79 {% load i18n admin_modify adminmedia %} 80 {% block extrahead %}{{ block.super }} Is it only me ? Olivier.
Re: How to redirect to the last visited page after login/registration completion
I would like to add that a link to the login/registration form appears on each page of my site (i.e defined in base.html)
Hard time with authentication
Hello, I'm quite perfectionist and I do have a deadline for my project ! But authentication is a little bit hard and not so well documented. Here is my view (see comments please): class UserRegManipulator(formfields.Manipulator): def __init__(self): self.fields = ( formfields.TextField(field_name="username", validator_list=[self.userNotExists], length=30, maxlength=200, is_required=True), formfields.EmailField(field_name="email", is_required=True), formfields.PasswordField(field_name="password", length=10, is_required=True), ) def userNotExists(self, field_data, all_data): try: users.get_object(username__exact=field_data) except: pass else: raise validators.ValidationError("User already exists.") def user_reg(request): manipulator = UserRegManipulator() if request.POST: new_data = request.POST.copy() errors = manipulator.get_validation_errors(new_data) if not errors: new_user = users.create_user(new_data["username"], new_data["email"], new_data["password"]) # SO FAR SO GOOD # BUT: HOW TO AUTMAGICALLY LOG THIS NEWLY CREATED USER WHILE REDIRECTING HIM TO THE NEXT FORM TO COMPLETE ? return HttpResponseRedirect("/contact_reg/") else: errors = new_data = {} form = formfields.FormWrapper(manipulator, new_data, errors) return render_to_response('contact/user_registration_form', {'form': form}) # THIS IS OK def login(request): manipulator = AuthenticationForm(request) if request.POST: errors = manipulator.get_validation_errors(request.POST) if not errors: request.session[users.SESSION_KEY] = manipulator.get_user_id() request.session.delete_test_cookie() #HERE I WOULD LIKE TO REDIRECT TO THE SAME PAGE INSTEAD OF THIS HARDCODED ONE: return HttpResponseRedirect('/events/') else: errors = {} #SAME AS ABOVE COMMENT return HttpResponseRedirect('/events/') Here is my base template: {% load i18n %} http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;> http://www.w3.org/1999/xhtml; xml:lang="en" lang="en"> {% block title %}{% endblock %} {% block login %} {% if user.is_anonymous %} Welcome. Please log in: {% trans 'Username:' %} {% trans 'Password:' %} or register. {% else %} Welcome, {{ user.username }}. Logout {% endif %} {% endblock %} {% block content %}{% endblock %} Thanks for your help, Olivier.
Re: gettext is not defined
It is OK now. Thanks a lot. Bye, Olivier.
Re: gettext is not defined
Bingo! There is no problem with en, but with fr ... Olivier.
Re: gettext is not defined
Request Method: GET Request URL:http://127.0.0.1:8000/admin/jsi18n/ Exception Type: KeyError Exception Value:'' Exception Location: C:\soft\django_src\django\views\i18n.py in javascript_catalog, line 156 Traceback (innermost last) C:\soft\django_src\django\core\handlers\base.py in get_response 73. response = callback(request, *callback_args, **callback_kwargs) C:\soft\django_src\django\views\i18n.py in javascript_catalog 156. # for l in t[''].split('\n'):
Re: gettext is not defined
>have you removed your .pyc files after svn up? yes >heck the source of the HTML pages wether there is a reference to the script >library in there and wether the path is correct The looks strange: http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;> http://www.w3.org/1999/xhtml; lang="fr" xml:lang="fr"> Change event | Site d'administration de Django ... Olivier.
Re: gettext is not defined
Georg, I did not overload any admin template. The problem appears the last time calendar.js and DateTimeShortcuts.js have been updated by svn up. Do I need to add a parameter in the corresponding model meta.Admin ? Olivier.
gettext is not defined
Hello, While gettext is in the PATH, I get the following javascript errors browsing an admin page with calendar and DateTime widgets: Erreur : gettext is not defined Fichier source : http://127.0.0.1:8000/media/js/calendar.js Ligne : 26 Erreur : gettext is not defined Fichier source : http://127.0.0.1:8000/media/js/admin/DateTimeShortcuts.js Ligne : 114 Is it a bug or do I need to set something somewhere ? I use FireFox 1.5 or IE 6 under Win2k. Olivier.
Re: Problem with i18n
Georg, it works only if I remove the r from the parameter at lines 78, 94 and 103. Olivier. PS: I have downloaded the win32 version of gettext from sourceforge.
Problem with i18n
Hello, C:\soft\Python23\Lib\site-packages\sonikete>make-messages.py -l fr processing language fr Traceback (most recent call last): File "C:\soft\django_src\django\bin\make-messages.py", line 78, in ? (stdin, stdout, stderr) = os.popen3(cmd, 'r') ValueError: popen3() arg 2 must be 't' or 'b' When I set the 2nd arg to t or b then: C:\soft\Python23\Lib\site-packages\sonikete>make-messages.py -l fr processing language fr errors happened while running xgettext on settings.py 'xgettext' n'est pas reconnu en tant que commande interne ou externe, un programme exécutable ou un fichier de commandes. There is no such xgettext on my system, do I need to download/install 3rd party tool ? Then I've created django.po by hand: C:\soft\Python23\Lib\site-packages\sonikete>compile-messages.py processing file django.po in C:\soft\Python23\Lib\site-packages\sonikete\locale\fr\LC_MESSAGES 'msgfmt' n'est pas reconnu en tant que commande interne ou externe, un programme exécutable ou un fichier de commandes. I have added the directory path which contain msgfmt.py to PATH but the result is the same. What do I need to do ? Olivier. ValueError: popen3() arg 2 must be 't' or 'b
Re: Problem with TinyMCE integration
Thanks a lot
Re: Exception Location: C:\soft\django_src\django\templatetags\adminmedia.py
Many thanks to everyone.
Exception Location: C:\soft\django_src\django\templatetags\adminmedia.py
Hello, when I try to access the admin site Django is complaining aout missing adminmedia.py which is true. There is a adminmedia.pyc instead. svn up does not retrieve the file. Debug message is: AttributeError at /admin/ 'module' object has no attribute 'register_tag' Tequest Method: GET Request URL:http://127.0.0.1:8000/admin/ Exception Type: AttributeError Exception Value:'module' object has no attribute 'register_tag' Exception Location: C:\soft\django_src\django\templatetags\adminmedia.py in ?, line 16 What is wrong ? Olivier.