Re: Problem installing pysqlite2 (for use with sqlite3)
On 10/8/07, benrawk <[EMAIL PROTECTED]> wrote: > > [EMAIL PROTECTED] pysqlite-2.3.5]# python setup.py build > running build > running build_py > running build_ext > building 'pysqlite2._sqlite' extension > gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -Wall -Wp,- > D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer- > size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables - > D_GNU_SOURCE -fPIC -fPIC -DMODULE_NAME="pysqlite2.dbapi2" -I/ -I/usr/ > include/python2.4 -c src/module.c -o build/temp.linux-i686-2.4/src/ > module.o > In file included from src/module.c:24: > src/connection.h:26:20: error: Python.h: No such file or directory > src/connection.h:27:22: error: pythread.h: No such file or directory > src/connection.h:28:26: error: structmember.h: No such file or > directory You're missing the Python development header files. Not sure how to tell you exactly what to get, since I don't know what distribution you are running. For what it's worth on Ubuntu these files are packaged in the python2.4-dev package. Maybe that will give a clue for what you need to get for whatever distro you are running? Karen --~--~-~--~~~---~--~~ 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: Getting strange error
On 10/8/07, Bourne <[EMAIL PROTECTED]> wrote: > > HEllo Russ, > > Thanks for the help.. I did the syncdb part. I am still > getting the same error. I even changed my DB from sqlite3 ato MYSQL.. The database error you are getting is fairly clear - the database does not contain the tables it requires. This means that either: 1) You haven't put the polls application in INSTALLED APPS. As a result of this, syncdb won't know that it needs to create tables for those models. 2) You are not synchronizing the database correctly and the tables have not been created. When you run syncdb you should get a 'Creating table poll_polls' message. If you have never received this message, you aren't synchronizing correctly. 3) You have synchronized one database but are using another. This usually indicates that you have a PYTHONPATH or other settings related problem. > I installed MYSQL and created a databse and user to it. I am getting > still weird errors like Unable to load MySqldb module This is a completely separate problem, and the error message tells you exactly what the problem is - you don't have a MySQLdb module installed. Django can't do anything to a database without the appropriate Python DB API. Yours, Russ Magee %-) --~--~-~--~~~---~--~~ 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: Getting strange error
HEllo Russ, Thanks for the help.. I did the syncdb part. I am still getting the same error. I even changed my DB from sqlite3 ato MYSQL.. I installed MYSQL and created a databse and user to it. I am getting still weird errors like Unable to load MySqldb module On Oct 7, 9:50 pm, "Russell Keith-Magee" <[EMAIL PROTECTED]> wrote: > On 10/8/07, Bourne <[EMAIL PROTECTED]> wrote: > > > > > Hello everybody, > > > I am new to Django I have hard time installing > > django. I am following every step of tutorials in the website > > djangoproject.com. > ... > > OperationalError: no such table: polls_poll > > > Getting this error PLEASE HELP > > Somewhere along the line you have missed a step - you haven't run: > > ./manage.py syncdb > > This command creates the database tables. As a result, your database > doesn't contain the table for the 'poll' model, and Django complains. > If you run the syncdb, all should be well. > > Yours, > Russ Magee %-) --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Problem installing pysqlite2 (for use with sqlite3)
Hello, I am new to Django. I have successfully installed sqlite3, but cannot install its companion program pysqlite2. Below is the what I get from running 'python setup.py build'. The error I eventually receive is 'error: command 'gcc' failed with exit status 1'. Any ideas what could be going on? Thank you for your help! [EMAIL PROTECTED] pysqlite-2.3.5]# python setup.py build running build running build_py running build_ext building 'pysqlite2._sqlite' extension gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -Wall -Wp,- D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer- size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables - D_GNU_SOURCE -fPIC -fPIC -DMODULE_NAME="pysqlite2.dbapi2" -I/ -I/usr/ include/python2.4 -c src/module.c -o build/temp.linux-i686-2.4/src/ module.o In file included from src/module.c:24: src/connection.h:26:20: error: Python.h: No such file or directory src/connection.h:27:22: error: pythread.h: No such file or directory src/connection.h:28:26: error: structmember.h: No such file or directory In file included from src/connection.h:30, from src/module.c:24: src/cache.h:34: error: expected specifier-qualifier-list before 'PyObject_HEAD' src/cache.h:44: error: expected specifier-qualifier-list before 'PyObject_HEAD' src/cache.h:61: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'pysqlite_NodeType' src/cache.h:62: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'pysqlite_CacheType' src/cache.h:64: error: expected declaration specifiers or '...' before 'PyObject' src/cache.h:64: error: expected declaration specifiers or '...' before 'PyObject' src/cache.h:67: error: expected declaration specifiers or '...' before 'PyObject' src/cache.h:67: error: expected declaration specifiers or '...' before 'PyObject' src/cache.h:69: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token In file included from src/connection.h:31, from src/module.c:24: src/module.h:30: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token src/module.h:31: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token src/module.h:32: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token src/module.h:33: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token src/module.h:34: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token src/module.h:35: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token src/module.h:36: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token src/module.h:37: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token src/module.h:38: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token src/module.h:39: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token src/module.h:41: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token src/module.h:44: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token src/module.h:45: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token src/module.h:51: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token In file included from src/module.c:24: src/connection.h:37: error: expected specifier-qualifier-list before 'PyObject_HEAD' src/connection.h:111: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'pysqlite_ConnectionType' src/connection.h:113: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token src/connection.h:115: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token src/connection.h:116: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token src/connection.h:117: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token src/connection.h:118: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token src/connection.h:119: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token src/connection.h:120: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token src/connection.h:121: error: expected declaration specifiers or '...' before 'PyObject' src/connection.h:121: error: expected declaration specifiers or '...' before 'PyObject' In file included from src/module.c:25: src/statement.h:36: error: expected specifier-qualifier-list before 'PyObject_HEAD' src/statement.h:44: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'pysqlite_StatementType' src/statement.h:46: error: expected declaration specifiers or '...' before 'PyObject' src/statement.h:49: error: expected declaration specifiers or '...' before 'PyObject' src/statement.h:50: error: expected declaration specifiers or '...' before 'PyObject' src/statement.h:52: error: expected declaration specifiers or '...' before 'PyObject' In file included from src/module.c:26: src/cursor.h:34: error: expected s
Re: default = current user
http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser On Oct 6, 5:10 am, "Alessandro Ronchi" <[EMAIL PROTECTED]> wrote: > Is it possible to set a field value as the current user in the admin panel? > -- > Alessandro Ronchi > Skype: aronchihttp://www.alessandroronchi.net- Il mio sito > personalehttp://www.soasi.com- Sviluppo Software e Sistemi Open Source --~--~-~--~~~---~--~~ 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: Getting strange error
On 10/8/07, Bourne <[EMAIL PROTECTED]> wrote: > > Hello everybody, > > I am new to Django I have hard time installing > django. I am following every step of tutorials in the website > djangoproject.com. ... > OperationalError: no such table: polls_poll > > Getting this error PLEASE HELP Somewhere along the line you have missed a step - you haven't run: ./manage.py syncdb This command creates the database tables. As a result, your database doesn't contain the table for the 'poll' model, and Django complains. If you run the syncdb, all should be well. Yours, Russ Magee %-) --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Getting strange error
Hello everybody, I am new to Django I have hard time installing django. I am following every step of tutorials in the website djangoproject.com. >>> from mysite.polls.models import Poll, Choice >>> Poll.objects.all() Traceback (most recent call last): File "", line 1, in ? File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/django/db/models/query.py", line 102, in __repr__ return repr(self._get_data()) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/django/db/models/query.py", line 470, in _get_data self._result_cache = list(self.iterator()) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/django/db/models/query.py", line 183, in iterator cursor.execute("SELECT " + (self._distinct and "DISTINCT " or "") + ",".join(select) + sql, params) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/django/db/backends/util.py", line 12, in execute return self.cursor.execute(sql, params) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/django/db/backends/sqlite3/base.py", line 93, in execute return Database.Cursor.execute(self, query, params) OperationalError: no such table: polls_poll Getting this error 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?hl=en -~--~~~~--~~--~--~---
Re: DB API - filter/exclude bug ?
> So my object ' de la tourelles>' can't appear in both queryset, right? Not necessarily. For example, if you had a Place ("Paris"), it may be associated with multiple users because of the ManyToManyField ("M2M"). In this case let's say Bob and Jane both have a M2M entries to Paris. When you filter excluding Bob's id, Jane's Place M2M entry is associated with a _different_ id, and thus the query will perform as you described above -- and still include the Paris entry associated with Jane's id. Check to see if you have multiple User models associated w/the 'Angle rues des princes et de la tourelles' place, for example, by performing the following query: qs = User.objects.filter(usual_places__name='Angle rues des princes et de la tourelles' ) -Justin --~--~-~--~~~---~--~~ 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: bug in rendering non ascii characters in admin changelist
On 08-Oct-07, at 7:36 AM, Malcolm Tredinnick wrote: > So keep hunting and do let us know if you find anything. will work on it - am busy for a couple of days - thanks for taking the trouble -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/web/ --~--~-~--~~~---~--~~ 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: sql_custom
apacheco, I'm a little late here, but FYI, this bug was fixed three weeks ago in r6395. Next time you encounter a problem like this please create a ticket in the Django trac (code.djangoproject.com) and specify the component as "GIS." I'm more likely to see tickets than postings in the user's group. Thanks, -Justin --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
variable assignment in template (or variable alias/map)
hi all I have a lot of small pieces of template like object.name and I need to inset these pieces here and there. I can define inclusion_tag for every piece, but their definitions look stupidly the same: def object(a): return {'a': a} object = register.inclusion_tag('object.html')(object) only object differs, so it is not the best solution. I tried to use {% include %} tag, but in different templates I need to refer to "object" by different names. let's say in template parent.html "object" called "childObject", in template child.html "parentObject", so I need kind of aliasing/mapping of variable names or variable assignment in template. currently I'm thinking about extension {% include %} tag for accepting third argument (for mapping) or custom tag like {% let object childObject %}. maybe there is better or standard approach exist for this? thanks Maxim Loginov http://zeliboba.by.ru --~--~-~--~~~---~--~~ 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: bug in rendering non ascii characters in admin changelist
On Mon, 2007-10-08 at 06:43 +0530, Kenneth Gonsalves wrote: [...] > I could not give the full traceback as the problem occured on a > production server and after I did a hack to fix it, I could not find > the error message again. I have reproduced the problem. I am using > python 2.4 and revision 6365. To reprduce the error, create a model > with one field: > > name = CharField of some some length and have > __unicode__() = "%s" %(self.name) > > in admin enter a finnish word with special characters like: Asikainen > Päivi ja Jorma. On saving, or after saving, on trying to edit the > word I get this error: Using this exact example and the test text you give, I cannot repeat this error using either [6365] or current head ([6463]) with sqlite (python2.3, 2.4 or 2.5), mysql or postgresql -- python 2.5, only, in both cases, since I'm not set up to test other Python versions with those database on my laptop. So more investigation is required on your end. Do the standard debugging stuff: put in debugging prints to show the data that is being passed into the template (in it's raw byte form -- maybe by putting debugging into the truncatewords filter). Maybe have a look at the bytes your browser is sending across the wire to see if it is sending the encoding you expect. Check that you really are running a clean checkout and not accidentally using any local modifications. Maybe print out the data that is making it into HttpRequest.POST. At this point, you need to work out why you are able to pass in data that isn't correctly encoded. Encoding conversion happens when we create the QueryDict (django/core/handlers/wsgi.py and modpython.py) and at the database layer. Nowhere else. So somehow you are smuggling bad data through one of those interfaces and it would be interesting to know how. At the moment we don't have a test case that can be repeated by anybody but you. And this is an area that is obviously exercised very regularly by anybody using non-ASCII characters. I would expect to see a bug report within about 10 seconds of committing something that broke it. So that suggests there is something different at your end and you need to try and figure out what that would be. So keep hunting and do let us know if you find anything. 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 -~--~~~~--~~--~--~---
Re: bug in rendering non ascii characters in admin changelist
On 07-Oct-07, at 8:25 PM, Malcolm Tredinnick wrote: > doing to cause the issue. It's also important to note which version of > Python you are using, as well as the database and the database > encoding > (and databse backend in the case of mysql or postgresql, since > there are > differences between the choices). I recently looked at another i18n > bug > of yours that appears to have been only caused with Python 2.3 and > that > sort of information is important to know when diagnosing these things. I could not give the full traceback as the problem occured on a production server and after I did a hack to fix it, I could not find the error message again. I have reproduced the problem. I am using python 2.4 and revision 6365. To reprduce the error, create a model with one field: name = CharField of some some length and have __unicode__() = "%s" %(self.name) in admin enter a finnish word with special characters like: Asikainen Päivi ja Jorma. On saving, or after saving, on trying to edit the word I get this error: UnicodeDecodeError at /web/admin/web/sponsorship/80/ 'ascii' codec can't decode byte 0xc3 in position 17: ordinal not in range(128) Request Method: GET Request URL:http://fida.nrcfosshelpline.in/web/admin/web/ sponsorship/80/ Exception Type: UnicodeDecodeError Exception Value:'ascii' codec can't decode byte 0xc3 in position 17: ordinal not in range(128) Exception Location: /usr/lib/python2.4/site-packages/django/utils/ encoding.py in force_unicode, line 37 Python Executable: /usr/bin/python Python Version: 2.4.4 Unicode error hint The string that could not be encoded/decoded was: nen Piv Template error In template /usr/lib/python2.4/site-packages/django/contrib/admin/ templates/admin/change_form.html, error at line 15 Caught an exception while rendering: 'ascii' codec can't decode byte 0xc3 in position 17: ordinal not in range(128) 5 {% for js in javascript_imports %}{% include_admin_script js %}{% endfor %} 6 {% endblock %} 7 {% block stylesheet %}{% admin_media_prefix %}css/forms.css{% endblock %} 8 {% block coltype %}{% if ordered_objects %}colMS{% else %}colM{% endif %}{% endblock %} 9 {% block bodyclass %}{{ opts.app_label }}- {{ opts.object_name.lower }} change-form{% endblock %} 10 {% block userlinks %}{% trans 'Documentation' %} / {% trans 'Change password' %} / {% trans 'Log out' %}{% endblock %} 11 {% block breadcrumbs %}{% if not is_popup %} 12 13 {% trans "Home" %} › 14 {{ opts.verbose_name_plural|capfirst|escape }} › 15 {% if add %}{% trans "Add" %} {{ opts.verbose_name|escape }}{% else %}{{ original|truncatewords:"18"|escape }}{% endif %} 16 17 {% endif %}{% endblock %} 18 {% block content %} 19 {% block object-tools %} 20 {% if change %}{% if not is_popup %} 21 {% trans "History" %} 22 {% if has_absolute_url %}{% trans "View on site" %}{% endif%} 23 24 {% endif %}{% endif %} 25 {% endblock %} I have left out the rest of the traceback since the above shows where the error is. If I delete this part of line 15 in change_form.html: {% else %}{{ original|truncatewords:"18"|escape }} then the error goes away - and some functionality also goes away. I am always reluctant to file bugs as that adds to your burden, but if you feel it is a bug, I will file one. -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/web/ --~--~-~--~~~---~--~~ 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: strange Q OR behaviour
On Sun, 2007-10-07 at 12:15 -0700, buzz wrote: > Thanks for the quick response Malcolm! Here are some details: The code you posted doesn't work. For a start, you've left out the all-important Experiment class and you are referring to a bunch of models that don't exist in this fragment. Plus this code is in the wrong order since it refers to models by reference before they are declared. So I can't paste it into a file and look at the SQL that is being generated. Please help us to help you by providing a small, self-contained illustration of the problem that we can use to repeat it. Asking me to mentally deconstruct complex relations between six classes and guess at the missing details of how they're linked in Experiment isn't fair. So let's try this another way. It's possibly an existing bug (#2080 would be a leading candidate, although that and #3592 are really just the tip of a larger iceberg here). Have a look at the SQL that is generated (see [1]). I wouldn't be too surprised if you find the join between the Deletion and Substitution tables is an inner join and should really be a left outer join, in which case you've hit the root cause of #2080/#3592 and a few other bugs. That one is fixed in the branch. Maybe there's some other problem that shows up. You might also want to have a glance through all tickets with "qs-rf" or "qs-rf-fixed" in the keywords field to see if that looks like the problem you're seeing. [1] http://www.djangoproject.com/documentation/faq/#how-can-i-see-the-raw-sql-queries-django-is-running 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 -~--~~~~--~~--~--~---
Re: model self reference
On 10/8/07, cjl <[EMAIL PROTECTED]> wrote: > > I'm a newcomer, so forgive my ignorance, but what real world > situations are recursive relationships good for? > > I was reading: > > http://www.djangoproject.com/documentation/model-api/#relationships > > They mention "recursive relationships", but I couldn't really figure > out what real world problem this relationship is useful for modeling. > > Can anyone point me in the right direction for further reading? Anything where objects have a relationship to objects of the same type - for example, any person must have a parent and may have children. Person, Parent and Child are all really one class - Person - with relationships on itself. Yours, Russ Magee %-) --~--~-~--~~~---~--~~ 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: model self reference
I'm a newcomer, so forgive my ignorance, but what real world situations are recursive relationships good for? I was reading: http://www.djangoproject.com/documentation/model-api/#relationships They mention "recursive relationships", but I couldn't really figure out what real world problem this relationship is useful for modeling. Can anyone point me in the right direction for further reading? --~--~-~--~~~---~--~~ 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: model self reference
On 10/7/07, Oleg Korsak <[EMAIL PROTECTED]> wrote: > hello! is it possible to do something like that?: > > class ModelClass(models.Model): > parent = models.ForeignKey(ModelClass,blank=True,null=True) Yes, and the exact technique you'll need is covered in the documentation. -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct." --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
model self reference
hello! is it possible to do something like that?: class ModelClass(models.Model): parent = models.ForeignKey(ModelClass,blank=True,null=True) signature.asc Description: OpenPGP digital signature
Re: Either category or project added to category
Hi Manuel! Am 07.10.2007 um 15:19 schrieb Manuel Meyer: > But what I want to have is, that any Category - that is parent for > any Project - cannot be parent for any Category and reverse. > > Is it possible, to filter the entries in the admins ForeingKey-list? > Got any hint for me? You can use the "limit_choices_to" argument [1] with a field lookup to filter the options of a ForeignKey field. Keep in mind that a lookup can be reverse [2] and relationship spanning [3]. For example you can achieve a simple filtered list of parent categories with the following model: class Category(models.Model): title = models.CharField(maxlength=50) parent = models.ForeignKey('self', limit_choices_to = {'parent__exact': None}, blank=True) You are able to create a parent category just by leaving the "parent" field empty. The category field will only contain categories which have no parents when you add more categories. I think you can get even more functionality by writing your own validator [4] and passing it with the "validator_list" argument, but I have no idea about the destiny of validators considering the newforms-admin branch. Hope that helps, Jannis 1: http://www.djangoproject.com/documentation/model-api/#many-to-one- relationships 2: http://www.djangoproject.com/documentation/models/reverse_lookup/ 3: http://www.djangoproject.com/documentation/db-api/#lookups-that- span-relationships 4: http://www.djangoproject.com/documentation/forms/#validators --~--~-~--~~~---~--~~ 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: Help with Jinja Template
Seems fine to me, templates do always look clumsy... I don't like though the {%- if tag in playlist %} syntax which, I guess, invokes some jinja magic and translates to something like getattr(playlist, tag, None) or hasattr(playlist, tag), but it's not that clear by reading the doc and your code which one is used (and which one you want : should the annotation tag be written if track.annotation is empty ?) Otherwise, since you're generating a limited-scope well-defined format, you could also go for a regular python method. Calling a template seems a little bit overkill. Regards, 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: strange Q OR behaviour
Thanks for the quick response Malcolm! Here are some details: class Mutation(models.Model): experiment = models.ForeignKey(Experiment, blank = True, null = True) insertion = models.ForeignKey(Insertion, blank = True, null = True) substitution = models.ForeignKey(Substitution, blank = True, null = True) deletion = models.ForeignKey(Deletion, blank = True, null = True) peptide = models.ForeignKey(Peptide, blank = True, null = True) simple_chimer = models.ForeignKey(SimpleChimer, blank = True, null = True) complex_chimer = models.ForeignKey(ComplexChimer, blank = True, null = True) class DeletionElement(models.Model): deletion_residue = models.ForeignKey(Residue) deletion_protein_section = models.ForeignKey(ProteinSection) class Deletion(models.Model): deletion = models.ManyToManyField(DeletionElement) class SubstitutionElement(models.Model): original = models.ForeignKey(Residue, related_name = 'original') mutated = models.ForeignKey(Residue, related_name = 'mutated') protein_section = models.ForeignKey(ProteinSection) class Substitution(models.Model): substitution = models.ManyToManyField(SubstitutionElement) class ProteinSection(models.Model): protein_section = models.CharField(maxlength = 10, primary_key = True) I've constructed the two following Q objects to search for deletions or substitutions in TM3 (transmembrane section 3) : a = Q(mutation__deletion__deletion__deletion_protein_section ='TM3') b = Q(mutation__substitution__substitution__protein_section='TM3') so, when filtering a, i get multiple hits, when filtering b too, but when i do Experiment.objects.filter(a) | Experiment.objects.filter(b) I get nothing. Is this behaviour the result of the 'old' queryset branch or am I doing something wrong here? On Oct 7, 8:54 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Sun, 2007-10-07 at 11:42 -0700, buzz wrote: > > I've got a number of Q objects, a and b. These Q objects search > > through a number of many2many relations. > > > If I do the following: > > > Experiment.objects.filter(a) > > number of results: 10 > > > Experiment.objects.filter(b) > > number of results: 20 > > > Experiment.objects.filter(a) | Experiment.objects.filter(b) to get the > > superset, i get 0 results. > > > How can this be? > > Since you don't actually provide concrete details it could be for any > number of reasons. If you want specific help, please provide a small > example that demonstrates the problem. > > Taking a wild guess, though, there are a number of problems with joining > QuerySets for m2m relations, particularly if they reference the same > fields. You could be hitting one of those. That is one of the things the > queryset refactor branch is fixing. If you want to, have a look at the > tests/regressiontests/queries/tests.py file in the queryset-refactor > branch and see your particular case is covered by one of the tests > there. > > 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 -~--~~~~--~~--~--~---
Re: strange Q OR behaviour
On Sun, 2007-10-07 at 11:42 -0700, buzz wrote: > I've got a number of Q objects, a and b. These Q objects search > through a number of many2many relations. > > If I do the following: > > Experiment.objects.filter(a) > number of results: 10 > > Experiment.objects.filter(b) > number of results: 20 > > Experiment.objects.filter(a) | Experiment.objects.filter(b) to get the > superset, i get 0 results. > > How can this be? Since you don't actually provide concrete details it could be for any number of reasons. If you want specific help, please provide a small example that demonstrates the problem. Taking a wild guess, though, there are a number of problems with joining QuerySets for m2m relations, particularly if they reference the same fields. You could be hitting one of those. That is one of the things the queryset refactor branch is fixing. If you want to, have a look at the tests/regressiontests/queries/tests.py file in the queryset-refactor branch and see your particular case is covered by one of the tests there. 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 -~--~~~~--~~--~--~---
strange Q OR behaviour
I've got a number of Q objects, a and b. These Q objects search through a number of many2many relations. If I do the following: Experiment.objects.filter(a) number of results: 10 Experiment.objects.filter(b) number of results: 20 Experiment.objects.filter(a) | Experiment.objects.filter(b) to get the superset, i get 0 results. How can this be? --~--~-~--~~~---~--~~ 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: Help with Jinja Template
Hey again. I think i solved my (Jinja) problems. Well, it works like i want to, but it still feels kinda clumsy. Take a look if you want: http://dpaste.com/21722/ I would still like some thoughts of you, how would you do this (since i'm new to templates and am looking for "Best Practice"). Or how would you do this with Django templates? Hope non of you is offended or something because I brougt the Jinja topic up. --~--~-~--~~~---~--~~ 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 Browser Games?
Yeah, similar to the other two respondents. But more of a space/ trading style thing. On Oct 6, 10:25 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Greetings, > > I was curious to hear if there are any Django-based browser games in > production or in progress. I'm particularly interested in anything > being openly developed. --~--~-~--~~~---~--~~ 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: Global Variables in Templates?
On Sun, 2007-10-07 at 16:21 +, niklas.voss wrote: > I searched around and haven't found anything about this Topic, so is > it possible to define Global Variables, which i can get in templates? > > So on my site i have a couple of settings, which are most time the > same and i didn't want to send them with every new app again with > render_to_response to the template, so i wan't a file or something > were i can define this constants. > > So is it possible to define Constants or Global Variables, which can i > get in every app? And is there a way to get them in the template, > without sending them with render_to_response? Look at TEMPLATE_CONTEXT_PROCESSORS and use RequestContext instead of Context in your views. See [1] for lots of details. Remember to read the note about to pass RequestContext to render_to_response(). [1] http://www.djangoproject.com/documentation/templates_python/#subclassing-context-requestcontext 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 -~--~~~~--~~--~--~---
Global Variables in Templates?
I searched around and haven't found anything about this Topic, so is it possible to define Global Variables, which i can get in templates? So on my site i have a couple of settings, which are most time the same and i didn't want to send them with every new app again with render_to_response to the template, so i wan't a file or something were i can define this constants. So is it possible to define Constants or Global Variables, which can i get in every app? And is there a way to get them in the template, without sending them with render_to_response? thank you very much, Niklas Voss P.S. sorry for my bad english :( --~--~-~--~~~---~--~~ 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-multilingual
I've use django-multilingual in many projects and happy. It's simple to integrate and use. No other implementations can do it so transparent for developer and end user( django-multilingual extends admin edit page and allows edit entry in all languages very simple). Use it! Chris Hoeppner: > Hi there! > > I wonder if someone has been using django-multilingual. I'd like to > "push it into" a live database, and am wondering what kind of > alterations to the schema this might involve. Would it be easier to just > add _lang columns for all the fields I'd like to translate, and > conditionally outputting based on the LANGUAGE context var? It seems > cleaner and more flexible the way django-multilingual goes, but the > alterations are frightening me a bit. > > ~Chris --~--~-~--~~~---~--~~ 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: joins
great, thanks --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
newforms: required field mark
Hello! Is there any built-in method to make my form show required field label with bold (or some king of mark like "*") and other fields as normal text signature.asc Description: OpenPGP digital signature
Django-multilingual
Hi there! I wonder if someone has been using django-multilingual. I'd like to "push it into" a live database, and am wondering what kind of alterations to the schema this might involve. Would it be easier to just add _lang columns for all the fields I'd like to translate, and conditionally outputting based on the LANGUAGE context var? It seems cleaner and more flexible the way django-multilingual goes, but the alterations are frightening me a bit. ~Chris --~--~-~--~~~---~--~~ 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 Browser Games?
I am working on a same type of webgame, and it's also on the very early stage. though it supports Chinese and English, now the content is mainly in Chinese, so I just can't write the testing address here. I'll mail to you, if you are interest, just take a look there. On 10月7日, 下午10时33分, Russell <[EMAIL PROTECTED]> wrote: > I am currently working on a Django-based browser game. It's still in > the very early stages right now, laying framework and still heavily in > the design stage. > > I don't really want to say much about it yet, but it is designed to be > massively (100+) multi-player and is a real-time strategy game. > > Russell > > On Oct 6, 11:25 pm, "[EMAIL PROTECTED]" > > > > <[EMAIL PROTECTED]> wrote: > > Greetings, > > > I was curious to hear if there are any Django-based browser games in > > production or in progress. I'm particularly interested in anything > > being openly developed.- 隐藏被引用文字 - > > - 显示引用的文字 - --~--~-~--~~~---~--~~ 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: joins
On Sun, 2007-10-07 at 15:23 +, Goon wrote: > > > Is there a way to get a bunch of value1's using something like this: > > MyOtherClass.objects.all().myClass.value1 This is just standard Python stuff: [o.myClass.value1 for o in MyOtherClass.objects.all()] Don't forget that Django is just built on top of Python. Most problems are solved by using the underlying language. 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 -~--~~~~--~~--~--~---
Re: joins
Is there a way to get a bunch of value1's using something like this: MyOtherClass.objects.all().myClass.value1 Thanks --~--~-~--~~~---~--~~ 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: joins
On Sun, 2007-10-07 at 15:01 +, Goon wrote: > if my database looks like this: > > class MyClass(models.Model): > value1 = models.IntegerField() > > class MyOtherClass(models.Model): > value2 = models.IntegerField() > myClass = models.ForeignKey(MyClass) > > > can I have a view that joins those two so that the result contains > value1 and value2? Any instance of MyOtherClass will already give you access to value1: obj.myClass.value1 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 -~--~~~~--~~--~--~---
Re: newforms admin branch ?
On Sun, 2007-10-07 at 14:51 +, Amirouche wrote: > Hello, > > I'm starting a new project and I'm planning to use a lot django's > admin interface. Since I work with the trunk branch I'm wondering > whether I should use the newforms-admin. > > My questions are: > - In which state is currently the newforms-admin > - Should I use it ? > - How should I use id, eg: should I merge the trunk and newforms-admin > branch together. The branch is reasonably well developed. Have a look at the NewformsAdminBranch page in the wiki. That also explains how to get the branch. You do not merge it into trunk -- it's self-contained. To get an idea of current work on the branch and stability, browse django-dev archives and look at the posts about newforms-admin. All of this could have been discovered by searching Google, though. Note, that the code isn't finished yet and there are still a number of tickets open against it -- look in Trac for tickets in the newforms-admin version to see a sample of these. Note that not all of the tickets are necessarily legitimate; some of them are wishlist items, rather than bugs. However, most of them are things that will need to be addressed at some point, possibly after it is merged back into trunk, possibly before. You are going to have to be prepared to pay close attention to changes, existing tickets and your own code to use newforms-admin. There's a reason it isn't the main line yet. That being said, it's perfectly possible to use it -- quite a few people are. Just be aware of the limitations and that you are using code that isn't production ready and where some pieces are still designed. 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 -~--~~~~--~~--~--~---
joins
if my database looks like this: class MyClass(models.Model): value1 = models.IntegerField() class MyOtherClass(models.Model): value2 = models.IntegerField() myClass = models.ForeignKey(MyClass) can I have a view that joins those two so that the result contains value1 and value2? --~--~-~--~~~---~--~~ 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: bug in rendering non ascii characters in admin changelist
On Sun, 2007-10-07 at 12:28 +0530, Kenneth Gonsalves wrote: > Hi, > > after upgrading to the unicode branch - I am using svn trunk, I find > that in the changelist, when I want to change an entry where there > are non-ascii characters in the name, I am getting an ascii cant > decode the non-ascii characters. This is appearing in line 15 of > change_form.html, in this particular code block: {{ original| > truncatewords:"18"|escape }}. When creating a new record, the record > gets saved, but the changelist with the success message doesnt come > up. The same problem arises if I try to edit the particular item. > This only happens when non-ascii characters are in the name to be > edited. Otherrwise the app is fully unicode and there are no > problems. I have temporarily solved the problem by removing {{ orig > {{ original|truncatewords:"18"|escape }}, but this is of course a > temporary and bad hack. Does a bug report need to be filed for this? It sounds like "original" is not UTF-8 or Unicode, so you might want to investigate that. However, non-ASCII characters have been pretty thoroughly tested throughout Admin, including loading, saving and viewing in change logs. So it's not universally broken and there's something special about what you are doing. If you do decided it's a problem in Django, please include a small example (as small as possible) and the exact steps to reproduce the problem -- it's not clear to me from the above description what you are doing to cause the issue. It's also important to note which version of Python you are using, as well as the database and the database encoding (and databse backend in the case of mysql or postgresql, since there are differences between the choices). I recently looked at another i18n bug of yours that appears to have been only caused with Python 2.3 and that sort of information is important to know when diagnosing these things. 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 -~--~~~~--~~--~--~---
newforms admin branch ?
Hello, I'm starting a new project and I'm planning to use a lot django's admin interface. Since I work with the trunk branch I'm wondering whether I should use the newforms-admin. My questions are: - In which state is currently the newforms-admin - Should I use it ? - How should I use id, eg: should I merge the trunk and newforms-admin branch together. Regards, Amirouche B. --~--~-~--~~~---~--~~ 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: making a site in 1 lanaguage but not in english?
On Sun, 2007-10-07 at 06:57 +, lgr888999 wrote: > Hi! > > > I've been working with django now for a while and its come to the time > to make a site in Swedish. > > How am I best of? > > Make the site in English and use djangos i18n support to translate > everything to swedish and use a snippet like > http://www.djangosnippets.org/snippets/218/ > to prevent people from accessing the english version? > > Feels a little bit like some overkill but could be good later if I > would like to go multilingual > > I've noticed that i need # -*- coding: utf-8 -*- in the begining of > all .py files if i use swedish chars like åäö in strings. I kind of > like this approach because the percentage that this site will go > english/multilingual is zero, But I also noticed I cant change > messages like "This field is required." without i18n. > > So guys, what do you think? If you want Django's core messages to appear in anything other than English, you'll need to use the i18n support in Django. However, that doesn't mean you need to use the LocaleMiddleware. You can set the LANGUAGE_CODE setting to 'sv-se' and USE_I18N=True and then everything should appear in Swedish by default. The snippet you refer to is trying to handle a slightly unusual case where he wants to allow multilingual versions of the site, but change the way Django works out the language to use. Using that snippet looks like a bad idea, no matter what the circumstances (even the use case mentioned isn't a real justification). In your case, just don't use the LocaleMiddleware and your users won't have any influence over the locale used for the site. 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 -~--~~~~--~~--~--~---
Re: bug in rendering non ascii characters in admin changelist
Did you rename your model's __str__ method to __unicode__? That's one of the things you need to do when upgrading to post-unicode Django trunk. There's a short checklist of things to change/look for in your code here: http://code.djangoproject.com/wiki/UnicodeBranch#PortingApplicationsTheQuickChecklist Every "can't decode" type error I encountered after updating my own installation was fixed by making one of the changes noted on the checklist. Karen --~--~-~--~~~---~--~~ 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 Browser Games?
I am currently working on a Django-based browser game. It's still in the very early stages right now, laying framework and still heavily in the design stage. I don't really want to say much about it yet, but it is designed to be massively (100+) multi-player and is a real-time strategy game. Russell On Oct 6, 11:25 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Greetings, > > I was curious to hear if there are any Django-based browser games in > production or in progress. I'm particularly interested in anything > being openly developed. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Help with Jinja Template
Sorry if this is too offtopic but I couldn't find any help resources for Jinja, not on the official page nor trough google. Since Jinja seems to be very similar to Djangos template system (at least that's what i read and why i choose Jinja, but I'm pretty new at both template systems) i hope someone here don't mind to help me out. I'm writing a tool, that parses playlists (m3u, etc.) to a generic yaml format and makes XSPF playlists out of that YAML. So here's my template for the XSPF: http://dpaste.com/21702/ And here's the example YAML playlist: http://dpaste.com/21704/ And finally the output: http://dpaste.com/21705/ First, there's a whole lot of if's in the template. I don't know if that's a good way to do such thing, maybe i should have done it another way. And secondly, even if the if-block is not printed (because the variable is not set) there will still be an empty line. OK, the second one is only cosmetic but i would prefer it otherwise. I found the use of "-" in tags to suppress the generating of white space before or after template tags in the docs (http://jinja.pocoo.org/ documentation/escaping#white space) but if i use '{%- if track.creator is defined %}{{ track.creator }}...' for example there is no whit space at all between the tags, which is kinda ugly too. Sorry again for being all that offtopic-ish and i apologize in advance if some of this makes no sense, or if me missing the obvious, i need sleep... badly i might add. Thanks for any hints. Oh and BTW, is there really no such thing as a jinja mailinglist? http://jinja.pocoo.org/ http://www.xspf.org/ --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Either category or project added to category
Hey, I have Category and Projects. Both can have a Category as parent = models.ForeignKey(Category). So it is possible, that Projects and Categories can have the same Category as parent. But what I want to have is, that any Category - that is parent for any Project - cannot be parent for any Category and reverse. Is it possible, to filter the entries in the admins ForeingKey-list? Got any hint for me? Manuel --~--~-~--~~~---~--~~ 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: i18n: newform validation errors: some translate, some not
Hello Malcolm, > Are the error strings in question in the > django/conf/local/de/LC_MESSAGES/django.po file and are they translated > there (i.e. "msgstr" is not just the empty string)? I've looked through the django.po file and think there's the reason for it. Some msgids for the error messages are missing in the po-file, and therefore they can't be translated of course. Should have looked there first ;) Thanks for your help, Andreas --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---