Re: Using new messages framework within built-in admin ?

2010-05-27 Thread Nicolas Steinmetz
Nobody on this issue ? On 21 mai, 15:46, Nicolas Steinmetz wrote: > Hi, > > For some actions I made from the Django built-in admin, I would like > to improve the user experience with a better distinction between > sucess & error messages. > > With Django 1.1.x, I used t

Using new messages framework within built-in admin ?

2010-05-21 Thread Nicolas Steinmetz
Hi, For some actions I made from the Django built-in admin, I would like to improve the user experience with a better distinction between sucess & error messages. With Django 1.1.x, I used to use Model admin actions [1] with statements like : modeladmin.message_user(request, "%s successfully

Re: Best way to generate a local file from a models + views ?

2009-10-19 Thread Nicolas Steinmetz
Михаил Лукин a écrit : > For purpose of generating apache config files I would recommend to use > management commands [1], so that you could generate config like this: > ./manage genconf --server apache2 > /etc/apache2/vhosts.d/myapp.conf > where genconf is your custom management command. > > [1

Re: Best way to generate a local file from a models + views ?

2009-10-19 Thread Nicolas Steinmetz
Daniel Roseman a écrit : > There's nothing magical about creating a file in Django, it's just > Python. Assuming you have rights to write to a file, that should work. It's what I was assuming but looks I did not find the right way to do it :-( > Is render_to_string producing anything? Can you t

Re: Best way to generate a local file from a models + views ?

2009-10-19 Thread Nicolas Steinmetz
Re, Anybody for helping me in my quest ? Nicolas On 16 oct, 21:58, Nicolas Steinmetz wrote: > Hello, > > I'm building a django app to manage the reverse proxies of my firm. I'm > at the step where I want to generate configuration files for apache and > then send it

Best way to generate a local file from a models + views ?

2009-10-16 Thread Nicolas Steinmetz
Hello, I'm building a django app to manage the reverse proxies of my firm. I'm at the step where I want to generate configuration files for apache and then send it from the server that host the django app to the reverse proxies. I built a view base on a generic view (object_detail) with some

Re: limit_choices_to & get_sql()

2009-09-22 Thread Nicolas Steinmetz
On 22 sep, 23:31, Daniel Roseman wrote: > Seems like you're looking at the ForeignKey documentation. The > reference to get_sql() is confusing and very out of date on that page > - Q objects don't have such a method, although they may have done back > before the merge of queryset-refactor before

limit_choices_to & get_sql()

2009-09-22 Thread Nicolas Steinmetz
Hello, I would like to present only a subset of a given models. But so far, in the admin, I have no value whereas there should be some. I tried several syntax but did not find the right one. Here are my implicated (and simplified) models : class Dns(models.Model): """ DNS description

Django & Couchdb ??

2009-06-11 Thread Nicolas Steinmetz
Hello, Interesed by couchdb, I would be interested to use both django & couchdb. I see that there is at least 6 implementations : - couchdb-django : http://code.google.com/p/couchdb-django/ - not updated since last august - django-couchdb : http://code.google.com/p/django-couchdb/ - not update

Re: Question about django.views.generic.simple.redirect_to

2009-05-29 Thread Nicolas Steinmetz
Russell Keith-Magee a écrit : > You could probably genericize your redirect_to_url view a little bit > more - you could make the class that is used for lookup configurable, > for example - but you have essentially hit on the solution. > > The issue is that 'shortcut', as captured by the regular e

Question about django.views.generic.simple.redirect_to

2009-05-22 Thread Nicolas Steinmetz
Hi, I was thinking about something like the following in urls.py : (r'(?P\w+)', 'django.views.generic.simple.redirect_to', {'url': Shorturl.objects.get(slug=shortcut).url }), But I did not manage to make it work. In the meanwhile I did this which works but I'm a little "disappointed" wi

Re: unicode/str not callable

2009-02-19 Thread Nicolas Steinmetz
Nicolas Steinmetz a écrit : > > Thanks for the answer. I'll implement the 2nd method, which makes far > more sens than my first "harsh and straight away" approach ;-) Solution was finally : try: tips ={'google': goo

Re: unicode/str not callable

2009-02-18 Thread Nicolas Steinmetz
Malcolm Tredinnick a écrit : > Method #2: create a dictionary mapping "engine" values to the right > callable. > > try: > {'google': google, > 'yahoo': yahoo, > # ... > }[engine](...) > except KeyError: > # Engine name

unicode/str not callable

2009-02-18 Thread Nicolas Steinmetz
Hello, I have in mind in a tiny app to allow user to set a search box with the provider they wish. I base this on web_search and then did the following : # Create your models here. class SearchBox(models.Model): CROP_ANCHOR_STR = ('dmoz', 'ask', 'google', 'googlefr', 'excite', 'msn', 'ya

Snippets app ?

2009-01-29 Thread Nicolas Steinmetz
Hi djangonauts, For my site, I planned to include a snippets app and was thinking about cab [1] which powers djangosnippets or some other snippets app. For Cab, it looks it's not updated since April 2007 so I think it's not compatible with Django 1.0.x or do not take benefit from 1.0.x feature

Re: Error with PGSQL and not with SQLite with count() ?

2009-01-13 Thread Nicolas Steinmetz
alex.gay...@gmail.com a écrit : > You're problem is you are testing identity with `is` when you want to > test equality, which you should do with ==, this is likely causing the > condition expect to pass to fail, and therefore your function returns > None, which plainly isn't an HttpResponse obje

Error with PGSQL and not with SQLite with count() ?

2009-01-13 Thread Nicolas Steinmetz
Hello, The following view works well with SQLite but since I switched to PostgreSQL 8.3, I have the following error : ValueError at /start/ The view start.views.index didn't return an HttpResponse object. Views is : def index(request): """ Try to see if there is a default theme to d

Re: Issue with django-tagging 0.3 (svn) with models definition

2008-07-09 Thread Nicolas Steinmetz
Nicolas Steinmetz wrote: > On Jul 9, 11:10 am, "Marek Stępniowski" <[EMAIL PROTECTED]> > wrote: > >> It seems you are running into one of django-tagging quirks. >> See issue #95 >> [http://code.google.com/p/django-tagging/issues/detail?id=95]. >

Re: Issue with django-tagging 0.3 (svn) with models definition

2008-07-09 Thread Nicolas Steinmetz
On Jul 9, 11:10 am, "Marek Stępniowski" <[EMAIL PROTECTED]> wrote: > It seems you are running into one of django-tagging quirks. > See issue #95 [http://code.google.com/p/django-tagging/issues/detail?id=95]. Oh thanks I missed this issue. I'll test it this evening. Regards, Nicolas --~--~-

Re: Issue with django-tagging 0.3 (svn) with models definition

2008-07-08 Thread Nicolas Steinmetz
Nicolas Steinmetz wrote: > > Hello, > > Despite I read a lot of time the overview.txt on the django tagging svn > repository, I still can't stand how to use it at my model's level. I'm > quite new to python and may miss some elements. > > When di

Issue with django-tagging 0.3 (svn) with models definition

2008-07-05 Thread Nicolas Steinmetz
er(Links) But when I try to save a link, I got : IntegrityError at /admin/links/links/add/ tagging_taggeditem.object_id may not be NULL What did I miss ? Regards, Nicolas -- Nicolas Steinmetz http://www.steinmetz.fr/ http://www.unelectronlibre.info/ --~--~-~--~~~--

Re: Beej's Flickr API

2008-03-25 Thread Nicolas Steinmetz
Michael J a écrit : > Has anyone attempted to implement Beej's Flickr API with Django? Personnaly, I use Flick.py [1] which works like a charm :) [1] --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: djWarehouse - Django based e-commerce system

2008-02-18 Thread Nicolas Steinmetz
[EMAIL PROTECTED] a écrit : > Hello, > > I am pleased to announce the immediate availability of djWarehouse e- > commerce system, developed on Django. Could you provide a quick bench / swot against satchmo project as it looks you have the same objectives (being an e-commerce platform). Regards

Re: SQL Join

2008-02-13 Thread Nicolas Steinmetz
Gus a écrit : > any help would be much appreciated Maybe this thread will help you (my issue was quite similar) Nicolas --~--~-~--~~~---~--~~ You received this message because y

Re: Issue on joining objects/table

2008-02-13 Thread Nicolas Steinmetz
Malcolm Tredinnick a écrit : So the solution is : In views.py : user_skill = user.userskill_set.all().select_related() results = [{'domain': o.name.domain, 'item': o} for o in user_skill] (exactly as said by Malcolm) And in the template : >{% regroup results by domain as domain

Re: Issue on joining objects/table

2008-02-12 Thread Nicolas Steinmetz
Malcolm Tredinnick a écrit : > Ah, ok. So one solution is to twist your initial template a little bit. > Normally, whenever you insert the outer "li" element (the headings), you > really want to insert "New Heading" -- closing the > previous inner section, displaying a heading and then starting a

Re: Issue on joining objects/table

2008-02-12 Thread Nicolas Steinmetz
Malcolm Tredinnick a écrit : > You don't mention which of the "ul" elements is coming out empty, but I > guess this happens in the case where user_skill is empty. So wrap that > section in an {% if user_skill %} template tag (wrap it around the > and close it after the closing ). Oups I was not

Issue on joining objects/table

2008-02-11 Thread Nicolas Steinmetz
Hello, In my app, I have the following : - "Userskill" allows a given user to link 1 to n skills thanks to a Foreign Key to "Skill" model - In Skill model there is a foreign key to "Skilldomain". I would like to display all the skills for a given user by skill domains. I have such models (simp

Re: SVN7049 - bug with development server ?

2008-02-01 Thread Nicolas Steinmetz
Jarek Zgoda a écrit : > I see this error frequently when using Firefox. Never saw this with > Opera, IE or Safari. I confirm it's with Firefox. I do not have this with konqueror. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the G

SVN7049 - bug with development server ?

2008-01-31 Thread Nicolas Steinmetz
Hello, On my Debian Lenny box, with Python 2.5.1, I have the following error the first time I generate a page. When I refresh the page, I have the normal output (ie listing css, html, images files) Traceback (most recent call last): File "/usr/lib/python2.5/site-packages/django/core/serve

Re: i18n - gettext issue with simple quote

2007-11-30 Thread Nicolas Steinmetz
[EMAIL PROTECTED] a écrit : > Hello, > > In my po file, I need some french words with simple quote like : > > #: models.py:497 > msgid "User's skills" > msgstr "Compétences d\'un utilisateur" > > But when I use compile-message.py , I got fatar errors and as a reason > "Invalid control sequence"

Re: [i18n] Questions on how it works...

2007-11-13 Thread Nicolas Steinmetz
Nicolas Steinmetz a écrit : > Any idea about this ? my fault, I forgot the locale middleware and I set a "conf/locale" structure within my app whereas it should be just "locale". This way, I do not need blocktrans any

[i18n] Questions on how it works...

2007-11-13 Thread Nicolas Steinmetz
Hello, I read the i18n documentation but I'm not really at ease with it. If I understood well : * To translate models, I need to use gettext_lazy or ugettext_lazy * In template : ** I need to set {% load i18n %} at the top of my template (should it be only in base.html or to any template part I

Re: Comparing date

2007-10-30 Thread Nicolas Steinmetz
Doug B a écrit : > Try just using the year attribute on the datetime instance. > > {% ifequal training.start_date.year training.end_date.year %} > ... Thanks a lot. It works ! Nicolas --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Comparing date

2007-10-30 Thread Nicolas Steinmetz
Hello, Issue : I would like to compare date at year level only. Idea is to display the year only once if the two date are within the same year. I have the following model : class Training(models.Model): who = models.ForeignKey(User, verbose_name='Person') title = models.CharField('Na

Re: Cab issue

2007-10-14 Thread Nicolas Steinmetz
[EMAIL PROTECTED] a écrit : > Exception Value: Template u'base.html' cannot be extended, because it > doesn't exist It's a "convention" in django that your main template is named "base.html". It should be place in the root directory of your template directory. Let's imagine : /templates/

Re: disguising a django app as php?

2007-09-26 Thread Nicolas Steinmetz
omat a écrit : > Any ideas / suggestions? It sounds ridiculous for me and if you do not host the app, you'll have trouble with the hosting company for which the customer required a LAMP with a P like PHP whereas you need a LAMP with P like Python. Being honest is imho the best way. So just pr

Re: Issue with regroup and sorting with foreign keys

2007-09-11 Thread Nicolas Steinmetz
Samuel Adam a écrit : > I have had similar issues while sorting with foreignkeys, try > specifying the sort like this : > > {% regroup techskill.name.all|dictsort:"domain.id" by > domain as grouped %} Right ! You already told me about this a long long time ago. I just forgot. Thanks samuel ! :)

Issue with regroup and sorting with foreign keys

2007-09-11 Thread Nicolas Steinmetz
Hello, Below my model with which I have an issue : """ Technicat skills """ class DomainTechSkill(models.Model): name = models.CharField('Domaine de compétence technique', Maxlength=100, core=True) class Techskill(models.Model): who = models.ForeignKey(User, verbose_name='Personne',

Re: django-rendertext released

2007-09-11 Thread Nicolas Steinmetz
Ole Laursen a écrit : > There might be? I've never heard of that project and can't seem to > find it on Google. Do you have a URL? Yep, sorry : Nicolas -

Re: django-rendertext released

2007-09-11 Thread Nicolas Steinmetz
Ole Laursen a écrit : > We've just released django-rendertext 0.1, a Django app for using > custom fonts on a web page for headings and the like. It works by > dynamically creating images out of text snippets with a template tag, > e.g. {{ "Hello world!"|rendertext:"gentium"}}. The images are cac

Re: When 1.0 ?

2007-09-10 Thread Nicolas Steinmetz
est a écrit : > Hi I am a new web developer in django. Could anyone tell me when will > django go to 1.0? Will django support py3k? Is django worth learning > compared with other web frameworks like turbogears, RoR? based on what you can find when searching on the list : - 1.0 : when ready :-) -

Re: Django-based forum software?

2007-08-30 Thread Nicolas Steinmetz
Aaron Maxwell a écrit : > Hi, > > Does anyone know of a django forum app? I.e., to build a site providing a > user forum. > > This is kind of hard to search on - try googling for "django forum"... >

Re: Newbie Question: site working in dev, not in production...probable issue with httpd.conf

2007-07-02 Thread Nicolas Steinmetz
Wiley a écrit : > Here's the ultra-newbie question of the day. > > I have a lil' site running well under runserver, when I hook it up to > apache2 and mod_python, something goes wrong. For the EXACT same > python/django code, the admin site and all URLS come up fine in the > built-in server. Wh

Re: Bug with regroup ? (which does not regroup as he shoud / I hope...)

2007-06-30 Thread Nicolas Steinmetz
For the record, I modified a little bit my object but the key was in precising a lot |dictsort like the following case : {# -- Compétences techniques -- #} {% if user_techskill %} Compétences techniques : {% for tskill in user_techs

Re: Bug with regroup ? (which does not regroup as he shoud / I hope...)

2007-06-21 Thread Nicolas Steinmetz
Nicolas Steinmetz a écrit : > Nicolas Steinmetz a écrit : > [...] > >> I tried this but the bug persists. Sometimes it works well (technical >> skills are well regrouped by technical domaines) but if I refresh, it's >> no longer the case. >> >> I eve

Re: Bug with regroup ? (which does not regroup as he shoud / I hope...)

2007-06-19 Thread Nicolas Steinmetz
Nicolas Steinmetz a écrit : [...] > I tried this but the bug persists. Sometimes it works well (technical > skills are well regrouped by technical domaines) but if I refresh, it's > no longer the case. > > I even tried this on an easier object and it does not work

Re: Bug with regroup ? (which does not regroup as he shoud / I hope...)

2007-06-18 Thread Nicolas Steinmetz
Florian Apolloner a écrit : > I am not quite sure wheter my answer is correct, as you didn't post > your view, My view is quite simple : # Display the detail for a given CV def cv_detail(request, firstname, lastname): user = User.objects.get(first_name=firstname, last_name=lastname) u

Bug with regroup ? (which does not regroup as he shoud / I hope...)

2007-06-17 Thread Nicolas Steinmetz
Hello, I have the following Model : class Summary(models.Model): who = models.ForeignKey(User, unique=True, verbose_name='Personne') job_profile = models.CharField('Profil de poste', maxlength=100) summary = models.TextField('Résumé',) intervention_level = models.ManyToManyFi

Re: Bug with __str__(self) if we use "return %s %s" ???

2007-05-07 Thread Nicolas Steinmetz
Mike Axiak wrote: > > Hi, > > I copied the code exactly as you have it and tested, and -- as I > expected -- it worked fine. Are you sure you set the first_name and > last_name fields correctly? > Perhaps you're looking at the wrong object? Strange, it works well now. I did not know what I mad

Re: Bug with __str__(self) if we use "return %s %s" ???

2007-05-07 Thread Nicolas Steinmetz
Russell Keith-Magee wrote: > On 5/4/07, Nicolas Steinmetz <[EMAIL PROTECTED]> wrote: >> >> > In Django admin (0.96), when I save data, I have : >> > >> > L'objet Photo "first_name last_name" a �t� modifi� avec succ�s >> > Ou

Re: Bug with __str__(self) if we use "return %s %s" ???

2007-05-04 Thread Nicolas Steinmetz
Any idea ? Nicolas Steinmetz wrote: > > Hello, > > I have the following model : > > class Trombi(models.Model): > first_name = models.CharField("Pr�nom", maxlength=40) > last_name = models.CharField("Nom", maxlength=40

Re: IndexError at /admin/auth/user/1/- String index out of range & TypeError at /admin/auth/user/1/ - 'int' object is unsubscriptable

2007-05-04 Thread Nicolas Steinmetz
Any idea ? [EMAIL PROTECTED] wrote: > > Hello, > > For one of my models, I did the following thing : > > """ > Civil state > """ > > class Civilstate(models.Model): > CIVILITY_CHOICES = ( > ('single', 'C�libataire'), > ('taken', 'Mari�'), > ) > who = models.Fore

Bug with __str__(self) if we use "return %s %s" ???

2007-05-03 Thread Nicolas Steinmetz
Hello, I have the following model : class Trombi(models.Model): first_name = models.CharField("Prénom", maxlength=40) last_name = models.CharField("Nom", maxlength=40) photo = models.ImageField("Photo", height_field="80", width_field="80", upload_to="photos") url

Re: Generic View pass multiple objects

2007-04-30 Thread Nicolas Steinmetz
gsmith wrote: > > Hello, > I have a template file that when shown is going to be populated by > data from two different tables. I want to use the generic view > 'list_detail.object_list'. However, as far as I know I can only pass > one queryset to the object_list view. Is there a way that I c

Re: Integrating third parties script within django

2007-04-10 Thread Nicolas Steinmetz
Nicolas Steinmetz wrote: > > Hello, > > I read Flickr Integration page on wiki [1] and I see that the third > parties script FlickrClient was called through "from > project.directory.file import module" > > I tried the same with another lib in my

Integrating third parties script within django

2007-04-09 Thread Nicolas Steinmetz
Hello, I read Flickr Integration page on wiki [1] and I see that the third parties script FlickrClient was called through "from project.directory.file import module" I tried the same with another lib in my views.py file but it does not work : ViewDoesNotExist at / Could not import project.app.v

Re: ABSOLUTE_URL_OVERRIDES issue

2007-03-03 Thread Nicolas Steinmetz
James Bennett wrote: > I've just opened ticket #3646, which notes the problem here -- there's > an inconsistency between the docs and how we actually look things up > in ABSOLUTE_URL_OVERRIDES -- and a couple possible solutions. > > Nicolas, for the time being you can work around this by specify

Re: ABSOLUTE_URL_OVERRIDES issue

2007-03-03 Thread Nicolas Steinmetz
Really nobody ? It would really help me if someone could take a look at it... Nicolas Steinmetz wrote: > > Hello, > > To use "Cab", I got a path issue and need to override get_absolute_url > defined by James (I would like to avoid to change the models by itself to >

Re: ABSOLUTE_URL_OVERRIDES issue

2007-03-01 Thread Nicolas Steinmetz
Nicolas Steinmetz wrote: > > Hello, > > To use "Cab", I got a path issue and need to override get_absolute_url > defined by James (I would like to avoid to change the models by itself to > keep synchronized with its version). > > James set :

ABSOLUTE_URL_OVERRIDES issue

2007-02-28 Thread Nicolas Steinmetz
Hello, To use "Cab", I got a path issue and need to override get_absolute_url defined by James (I would like to avoid to change the models by itself to keep synchronized with its version). James set : def get_absolute_url(self): return "/languages/%s/" % self.slug Issue is that for

Re: Django and Eclipse Autocomplete NOT WORKING

2007-02-19 Thread Nicolas Steinmetz
Igor Guerrero wrote: > Apparently is a random error, I use the svn version, and with one project > it works and with another don't, maybe is a PyDEV bug, but I don't know. Hmm strange and what a pity ! :( I hope it will be solved with next stable version :-) --~--~-~--~~--

Re: Django and Eclipse Autocomplete NOT WORKING

2007-02-15 Thread Nicolas Steinmetz
Igor Guerrero wrote: > You must add the app dir and django dir to the PYTHON_PATH env variable in > the preferrence menu and rescan the PATH. It worked well with 0.95 version (just need to add django dir to the PYTHON PATH of Eclipse) but with svn version it looks it does not work any longer for

Re: Generic views and filtering

2007-01-20 Thread Nicolas Steinmetz
natebeaty wrote: > > You can do this without a wrapper -- your url entry was close: > > (r'^tag/(?P[-\w]+)/$','django.views.generic.list_detail.object_detail', > dict(queryset=Tag.objects.all(), template_object_name='tag', > slug_field='url')), > > and you'll get a list in /templates/tags/tag_

Re: Generic views and filtering

2007-01-15 Thread Nicolas Steinmetz
David Zhou wrote: On Jan 12, 2007, at 6:25 PM, Nicolas Steinmetz wrote: Do I have to do as James [1] suggests, ie to filter it in views.py with some generic views methodes ? That's the way I do it. It's a very simple wrapper, and also allows me to add a host of other thing

Generic views and filtering

2007-01-12 Thread Nicolas Steinmetz
Hello, I have a few question with generic views as I can't manage to have all posts related to a tag or category My model is : class Post(models.Model): author = models.ForeignKey(User) title = models.CharField(maxlength=50) summary = models.TextField(blank=True) message = model

Re: Django and mod_python issues

2006-12-05 Thread Nicolas Steinmetz
Tipan a écrit : > PythonPath "['d:/program files/xampp/htdocs/myproject'] + sys.path" Try : PythonPath "['d:/program files/xampp/htdocs/'] + sys.path" Nicolas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: manage.py can't see project

2006-12-01 Thread Nicolas Steinmetz
[EMAIL PROTECTED] a écrit : > Please. Anyone... I just want to be able to use manage.py AND the > project! - are you sure that django is well installed on your server ? - In your apache conf, do you have something like : SetHandler mod_python PythonHandler dja

Small comments on tutorial (improvements inside)

2006-11-27 Thread Nicolas Steinmetz
Hi, I was questionning about generic views a few days ago and I remembered it was covered on tutorial4 but as I did not have tutorial files longer on my PC, I was unable to retrieve them by memory. So to see how generic views could be handled, I had to start from tutorial 1. Therefore, I think

Re: [patch] Generating slug for words with accents

2006-11-16 Thread Nicolas Steinmetz
Maciej Bliziński a écrit : > I'm including a patch with "from" and "to" constants extended with all > the characters I found on Wikipedia that seemed to be of any use. This > should cover all the Slavic countries except those which use cyrylic > alphabet. Was this page commit to svn version of d

Re: runserver and static files

2006-11-14 Thread Nicolas Steinmetz
Jean-Luc a écrit : > I used media in place of site_media for directory name > It seems media shouldn't be used ? As media is set/defined for media admin in settings.py, I guess there is a conflict between the two values. With a different name (like site_media) it works. > Thanks Nicolas You'

Re: runserver and static files

2006-11-13 Thread Nicolas Steinmetz
Jean-Luc wrote: > igor Guerrero a écrit : > >> Django dont serve media files, that is the job of the production server >> but if yo are using the development server: you can try this: >> >> http://www.djangoproject.com/documentation/static_files/ Based on above doc, I had same trouble as you Je

Re: Displaying ManyToMany relation in template

2006-11-06 Thread Nicolas Steinmetz
Nicolas Steinmetz wrote: > In my views.py, do I need to set/declare anything about this ? > > If I just add the previous piece of code, I have a template error with > this line highlighted - I do not have it with me :-/ : > {% for category in post.category.all %} ok my fault

Re: Displaying ManyToMany relation in template

2006-11-06 Thread Nicolas Steinmetz
Nikolaus Schlemm a écrit : > hi, > > try something like the following: > >> {% if latest_posts %} >> {% for post in latest_posts %} >> >> {{ post.title }} >> >> publi

Re: Displaying ManyToMany relation in template

2006-11-02 Thread Nicolas Steinmetz
Nikolaus Schlemm a écrit : > {% for category in post.category.all %} > {{ category.title }} > {% endfor %} > [...] > -> http://www.djangoproject.com/documentation/models/many_to_many/ Indeed, I was looking for template code and did not look at the output of the shell ;-) I'll test all

Displaying ManyToMany relation in template

2006-10-31 Thread Nicolas Steinmetz
Hello, I'm testing django with a blog and I have the following issue : I have the following model : class Post(models.Model): author = models.ForeignKey(User) title = models.CharField(maxlength=50) summary = models.TextField(blank=True) message = models.TextField() category

Re: [tool] Autodoc (a script to grap and generate django documentation at html format)

2006-10-14 Thread Nicolas Steinmetz
Jyrki Pulliainen wrote: > Own trivial projects are the best way to learn things. Have fun diving > in to that world =) Done in a cleaner way (with use of pysvn and docutils lib). Nicolas --~--~-~--~~~---~--~~ You received this message because you are subscrib

Re: [tool] Autodoc (a script to grap and generate django documentation at html format)

2006-10-13 Thread Nicolas Steinmetz
Jyrki Pulliainen wrote: > Script seems to work. However: Python-docutils package (at least on my > Ubuntu Dapper) ships with buildhtml.py-script, which can be found in > /usr/share/python-docutils/ directory. That recurses through > directories converting all .txt files to .html. Recursive conver

[tool] Autodoc (a script to grap and generate django documentation at html format)

2006-10-13 Thread Nicolas Steinmetz
Hi, New to django/python, and as I work often in the train, I was interested in reading the djando doc offline. So I wrote my first python script that : * grap last version of the doc on the svn * generate html version of all files (via rst2html). autodoc is available here :

Re: 'bool' object has no attribute 'get' ??

2006-10-13 Thread Nicolas Steinmetz
Russell Keith-Magee a écrit : > Sorry for the long delay in responding to this message. no problem, it happens ;) > Django models can have multiple foreign keys; however, there are some > known issues with manipulators on models with self-referential foreign > keys that give the error message y

Re: 'bool' object has no attribute 'get' ??

2006-10-12 Thread Nicolas Steinmetz
Anyone has an idea about this as I would like to set this key so that I can have threaded comments. Otherwise what would you suggest me to implement threaded comments ? Nicolas Nicolas Steinmetz wrote: > > Hello, > > I have the following code but I do not understand why I ha

Re: Django and Ajax

2006-10-10 Thread Nicolas Steinmetz
puyuus a écrit : > hello again! > there are 2 weeks since i started using Django and I can say that i > done a lot of things easier then in PHP. > just one problem for today what can you tell me about the > combination between Django and Ajax? did somebody used Ajax with > Django; if yes... ho

Generic Relation vs ManyToMany (was Re: Organisational question)

2006-10-08 Thread Nicolas Steinmetz
Hi, John Sutherland wrote: > class BlogPost(models.Model): > categories = models.ManyToManyField(Category) > > It may be worth having a look at the generic relationships [1] stuff > and the Tag application used as an example. While the GR stuff in the > Django admin is truly horrible, you

Re: 'bool' object has no attribute 'get' ??

2006-10-06 Thread Nicolas Steinmetz
Nicolas Steinmetz wrote: > class Comment(models.Model): > author = models.CharField(maxlength=50) > email = models.EmailField() > title = models.CharField(maxlength=50) > comment = models.TextField() > post = models.ForeignKey(Post) > parent = mo

'bool' object has no attribute 'get' ??

2006-10-06 Thread Nicolas Steinmetz
Hello, I have the following code but I do not understand why I have the error below... could someone help me ? class Comment(models.Model): author = models.CharField(maxlength=50) email = models.EmailField() title = models.CharField(maxlength=50) comment = models.TextField()

Re: Organisational question

2006-10-01 Thread Nicolas Steinmetz
John Sutherland wrote: > On 1 Oct 2006, at 17:02, Nicolas Steinmetz wrote: >> to have 3 app (a blog app, a tutorial app and a category app) ? In >> the second case, the questions are : > > I would suggest this is the way to go, if you added another app, say > a photo g

Organisational question

2006-10-01 Thread Nicolas Steinmetz
Hello, I have a project for which I need : - a blog like app - a tutorial app (in which I'll publish tutorials...) I would like to be able to share categories between blog & tutorial app. Thus, if i have a theme "django" for ex, if I look at this theme, I would be able to see posts from blog and

Re: Help about tutorial1 (about Poll object)

2006-08-25 Thread Nicolas Steinmetz
Waylan Limberg a écrit : > Did you close your shell and restart it so that the changes can be imported? No I did not. As my (python) shell was open, I only did : from mysite.polls.models import Poll, Choice > I just checked the tutorial and you aren't expressly told that you > have to do so,

Help about tutorial1 (about Poll object)

2006-08-25 Thread Nicolas Steinmetz
Hello, I'm new in Django (so hello world :) ) but I have one question about tutorial1. Cf : http://www.djangoproject.com/documentation/tutorial1/ In polls/models.py, we have already two classes : from django.db import models # Create your models here. class Poll(models.Model): questi