Django & referential integrity

2008-12-05 Thread Thierry
I noticed that Django handles all the referential integrity issues for delete statements at the Python/ORM level. - Is this documented anywhere? Furthermore I can't seem to find a switch to turn the whole ORM/python level referential stuff off. Is there a setting for this somewhere? (I prefer the

MultipleChoiceField initial data

2009-01-13 Thread Thierry
This doesn't seem to work: auto_open_choices = forms.MultipleChoiceField(choices=( ('google', 'Google'), ('msn', 'MSN'), ('yahoo', 'Yahoo')), required=False, initial=['google']) >From what i read in the discussions here it should... What am i doing wrong? --~--~-~--~~~

template include and for loop speed

2009-03-06 Thread Thierry
the following use case {% for item in items %} {% with item.score as score %} {% include rating_small %} {% endwith %} {% endfor %} Using an include tag is very slow compared to pasting the included template here. My total template processing time goes up from 0.1 to 0.4 seco

Will future Django releases support multiple databases?

2009-06-25 Thread Thierry
Right now, Django doesn't seem to support the multiple databases on the same server or different servers. Will that feature be available out of the box for future releases? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Gro

Improve the django-contrib webdesign helpers ... for developers?

2009-07-09 Thread Thierry
Hi, The "webdesign" django.contrib add-on [1] currently implements only 1 templatetag, supposed to help web designers. I think Django could benefit from built-in elements that could be useful to web developpers too, out of the box. Some disorganized ideas that lead me to write this message: * Wh

Model field option "max_length" is not respected (Sqlite backend)?

2009-08-07 Thread Thierry
Hi, I have a model roughly defined as such (FK fields do not appear for simplicity): class FieldChange(models.Model): old_value = models.CharField(max_length=50) new_value = models.CharField(max_length=50) Using SQLite, the table definition roughly translates to: CREATE TABLE "fieldcha

Re: Model field option "max_length" is not respected (Sqlite backend)?

2009-08-07 Thread Thierry
Indeed, I had been confused by this documentation excerpt ([1]): "CharField.max_length: The maximum length (in characters) of the field. The max_length is enforced at the database level and in Django's validation." Now your clear and quick explanation makes sense. Fortunately most of my data is v

Re: Django documentation site is SLOW

2009-08-08 Thread Thierry
Hi, Just wanted to add my own testimony: I too, noticed serious performance issues with Firefox when consulting Django documentation. So far it is the only website where I experience this. I am home, using Firefox 3.5.2 on Ubuntu 9.04 (officially installed package 'firefox-3.5'), and have Adblock

How do I sort a ManyToManyField in Django admin?

2009-08-10 Thread Thierry
I currently have the following models: class Image(models.Model): alt_name = models.CharField(max_length=200) def __unicode__(self): return self.alt_name class Album(models.Model): images = models.ManyToManyField(Image, blank=True) class AlbumAdmin(admin.ModelAdmin): mo

Seamless integration of customized forms in my project

2009-08-18 Thread Thierry
thon... Should I stick with custom class names and refer to them throughout my project instead? Thanks for any feedback, Thierry. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To p

Re: Seamless integration of customized forms in my project

2009-08-18 Thread Thierry
You sold me on "this construction is unclear" and the "happy debugging" is scaringly convincing. I will stick with different classnames approach, with maintenance and portability (reusing apps) in mind. Thank you for your time. --~--~-~--~~~---~--~~ You received thi

QuerySet cache

2009-09-06 Thread Thierry
QuerySet cache is usually quite great. However when you are looping through a very large result set it would be great if I could turn it off. So here the question, how do I turn off the queryset cache? --~--~-~--~~~---~--~~ You received this message because you are

Re: QuerySet cache

2009-09-06 Thread Thierry
retrieval, not just object creation)? Cause from the docs it appears to read all data in memory and iterate the objects... http://docs.djangoproject.com/en/dev/ref/models/querysets/#iterator On Sep 6, 4:17 pm, Alex Gaynor wrote: > On Sun, Sep 6, 2009 at 10:14 AM, Thierry wr

Clarifications for apps and models

2009-04-07 Thread Thierry
I'll be referring to the example in the Django documentation here. I will extend on the "books" application in the "mysite" project by creating a new app called "music" so that the structure looks like the following: mysite/ books/ models.py - Contains Publisher, Author, Book mus

Target WSGI script cannot be loaded as Python module

2009-04-14 Thread Thierry
I'm currently running Apache 2.2 on Windows and I can get the hello world of modwsgi to run. However, when I configure my Django project, Apache has the following errors from the error.log file: mod_wsgi (pid=5956): Target WSGI script 'C:/django_proj/mysite/apache/ mysite.wsgi' cannot be loaded

Re: Target WSGI script cannot be loaded as Python module

2009-04-14 Thread Thierry
Hello world with import socket gave me the same issue. I just re- installed Python 2.6, more specifically 2.6.2 and everything is working fine, thanks for your help. On Apr 14, 10:25 pm, Graham Dumpleton wrote: > On Apr 15, 12:07 pm, Thierry wrote: > > > > > I'm curre

Query exclude in and selective sort questions

2009-04-16 Thread Thierry
Let's say I have a list of words in my database: ['bbb', 'aaa', 'zzz', 'ddd'] How can I retrieve a list of the above excluding the following words ['aaa', 'zzz'] by using __in? I can do the above with: words_list = Words.objects.exclude( Q(word_name = 'aaa') | Q(word_name = 'zzz')

How do I exclude a list from my search?

2009-04-17 Thread Thierry
Can someone tell me the equivalent QuerySet for the following sql: select city_name from city where city_name not in ('Toronto', 'Richmond', 'Montreal') >From the python code, I will like to store the above 3 cities in a list. --~--~-~--~~~---~--~~ You received th

urlconf {{ app }}/{{ view }}

2009-04-24 Thread Thierry
what if u want to have an urlconf as such /{{ app }}/{{ view }}/ so without specifying the view, it will dynamically load the app with the variable input and the view...? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Group

How do I set a foreign key as a primary key?

2009-05-03 Thread Thierry
I have the following model: class Person(models.Model): person = models.ForeignKey(User) age = models.IntegerField() How can I set the above foreign key to be my primary key so that my Person table only contains two columns (person, age)? --~--~-~--~~~---~--~-

Overriding save method in model

2009-05-05 Thread Thierry
I have the following model: class Pet(models.Model): name = models.CharField(max_length=64) picture = models.ImageField(upload_to='/usr/django/images/') def save(self, force_insert=False, force_update=False): // override the picture values super(Pet, self).save(force_

Re: Overriding save method in model

2009-05-05 Thread Thierry
On May 5, 3:48 pm, Daniel Roseman wrote: > On May 5, 8:00 pm, Thierry wrote: > > > > > I have the following model: > > > class Pet(models.Model): > >     name = models.CharField(max_length=64) > >     picture = models.ImageField(upload_to='/usr/djang

Re: Overriding save method in model

2009-05-06 Thread Thierry
just doing a simple conversion to Django. On May 6, 2:59 am, Daniel Roseman wrote: > On May 5, 10:15 pm, Thierry wrote: > > > How can I set picture to the image extension?  I don't think > > "instance.picture = ext" works: > > >  def pet_picture_upload(insta

How do I handle urls with different names?

2009-05-11 Thread Thierry
Let's say I have a pet table: TABLE: Pet id nametype -- 1 Plutodog 2 Foo cat 3 Goo fish I can access the pet page of each of the above by the following url: Pluto: localhost/pets/1/ Foo: localhost/pets/2/ Goo: l

Re: How do I handle urls with different names?

2009-05-12 Thread Thierry
pared to the retrieving a pet by id? How is this kind of situation handle in some of the Django web application out there? On May 11, 11:00 pm, Mike Ramirez wrote: > On Monday 11 May 2009 07:35:37 pm Alex Gaynor wrote: > > > > > On Mon, May 11, 2009 at 10:22 PM, Thierry wrote: &

How do you handle apostrophe and spaces in dynamic url?

2009-05-12 Thread Thierry
I have a table with the following names: id name 1 Foo 2 Foo goo 3 Foo's goo I want to use the name to construct my url. I don't have a problem constructing Foo: localhost/foo But how am I supposed to handle "Foo goo" and "Foo's goo"? Will I need to create a 3rd column

Does the objects.get method automatically escape single quote?

2009-05-12 Thread Thierry
My table has the following entry: id name 1 foo's I'm currently trying the following: value = "foo's" MyModel.objects.get(name = value) The above is raising the exception DoesNotExist. Doesn't the get function automatically escape the single quote? Is there also a way to output t

Re: Does the objects.get method automatically escape single quote?

2009-05-13 Thread Thierry
Thanks for the tip on the raw sql, I'll read the faq in more details. On May 13, 5:53 am, Daniel Roseman wrote: > On May 13, 2:25 am, Thierry wrote: > > > My table has the following entry: > > > id      name > > 1       foo's > > > I'm c

Re: Form errors manipulation - autofill values in case of error

2009-05-13 Thread Thierry
I was able to get the user input back if there are errors but I have a customized form class which extends the UserCreationForm. I was following the example at: http://www.djangobook.com/en/2.0/chapter14/#cn176 You will notice that if the user inputs are not valid, the view re- initialize the f

How do I override the __unicode__ of User?

2009-05-17 Thread Thierry
I currently have a blog model: class BlogPost(models.Model): title = models.CharField(max_length=150) body = models.TextField() author = models.ForeignKey(User) timestamp = models.DateTimeField() Right now, author is returning the default User.username. How can I customize the a

How do I override __unicode__ for User?

2009-05-17 Thread Thierry
I currently have a blog model: class BlogPost(models.Model): title = models.CharField(max_length=150) body = models.TextField() author = models.ForeignKey(User) timestamp = models.DateTimeField() Right now, author is returning the default User.username. I have other models who h

What's the recommended way to use ForeignKey?

2009-05-17 Thread Thierry
In the Django doc at http://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.ForeignKey, it mentions explicitly specifying the application label in 1.0: class Car(models.Model): manufacturer = models.ForeignKey('production.Manufacturer') The above is using a string for the

Re: How to save the data from a form to my db.

2009-05-18 Thread Thierry
Check this example, but they are using a customized form for models: http://www.djangobook.com/en/2.0/chapter14/#cn176 If your form is not derived from your model, you'll want to explicitly create the model object: def yourview(request): if request.method == 'POST': form = YourForm(

Re: MultiValueField with required=True problem

2009-05-18 Thread Thierry
Isn't required the default behaviour of Field: http://docs.djangoproject.com/en/dev/ref/forms/fields/ From the above code, TextInput is required: forms.TextInput(), On May 18, 1:15 pm, "[CPR]-AL.exe" wrote: > class CheckboxSelectWithTextInputWidget(forms.MultiWidget): > >     def __init__(sel

Re: Installing Django on Windows XP

2009-05-29 Thread Thierry
Try to unpack django from a directory with no white space in the name, for instance: C:\downloads\Django-1.0.2-final Make sure that you use a suitable unzip package. There is an issue with some version of winzip where empty __init__.py files are not extracted. On May 29, 12:54 pm, athick2 wro

Complex annotated/aggregated QuerySet ?

2009-10-16 Thread Thierry
Hi, Considering the following models (simplified time-tracking app): - class Objective(models.Model): pass class Task(models.Model): status = models.IntegerField() objective = models.ForeignKey(Objective, related_name='tasks') ---

Re: Complex annotated/aggregated QuerySet ?

2009-10-17 Thread Thierry
Thanks Javier, This is the perfect translation of the SQL I came up with. I was almost there, but just afraid of having to play with 'extra' and raw SQL. Thierry. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Goo

How to attach managers to models (outside model definition)?

2009-10-17 Thread Thierry
Thanks in advance, I could not see any similar message request or any ticket filled in against documentation. Thierry. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group

Re: Please help: {% url ... %} path resolve issue

2009-10-17 Thread Thierry
Hi, Could it be that you are missing trailing slashes in customer add/edit/ delete url patterns? E.g try: (r'^customer/(?P\d+)/edit/$', 'customer_edit'), instead of: (r'^customer/(?P\d+)/edit$', 'customer_edit'), Thierry. On 17 oct, 14:12, Gerard wrote

Django javascript includes

2009-11-17 Thread Thierry
Other frameworks (Symfony) offer simple hooks for managing js includes. In Django its simply a line of template code. This is annoying for managing JS dependencies. Did anyone write a nice little framework for managing js? -- You received this message because you are subscribed to the Google Gr

Specifying an order_with_respect_to for a self referential one to many relationship (still) fails

2010-05-07 Thread thierry
Hi all, I'd like to know if this problem, described in this post http://www.google.com/url?sa=D&q=http://groups.google.com/group/django-updates/browse_thread/thread/e247ff8079eda192&usg=AFQjCNHKyZDdY0P7z3TnSKg92GnTnlNz0Q, will be solved in the next stable release of Django. Thanks. -- You recei

Django ORM and multidimensional data

2010-05-07 Thread thierry
h the scientific community where Python and databases are more and more popular to store experimental and analyses data. Thanks, Thierry. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googl

Subclassing models.Model to extend base functionalities and attributes

2010-05-07 Thread thierry
e. Thanks, Thierry. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more optio

Re: Subclassing models.Model to extend base functionalities and attributes

2010-05-11 Thread thierry
le because it forces directly to a database model inheritance. Consequently, I will abadon this way and focus on signal dispatcher because it seems possible to trigger homemade functions happening before or after models.Model methods execution. But I stay tuned if somebody has got a solution

Re: Specifying an order_with_respect_to for a self referential one to many relationship (still) fails

2010-05-11 Thread thierry
This bug is 4 years old. Weird that It was not corrected yet because it seems to be a core functionality of the ORM. Do django developpers have planned something before 1.2 stable release ? Regards, Thierry. -- You received this message because you are subscribed to the Google Groups "D

Ordering a QuerySet by a Python property ?

2010-05-19 Thread thierry
Hi all, The order_by method makes possible to sort objects relatively to a specified field. But how can I sort a QuerySet relatively to a Python property ? Thanks, Thierry. -- You received this message because you are subscribed to the Google Groups "Django users" group. To po

testing the comment framework using the test client

2010-05-25 Thread Thierry
How do you guys test implementations of the django comment framework? A regular post doesnt seem to work because it depends on data from a previous get. An thoughts? def test_comment(self): item_url = reverse('item', args=['4558']) self.client.login(username=self.username, pass

Re: Problem in Django App Part 1 Tutorial

2010-06-16 Thread Thierry
I noticed you are importing your project name, are you invoking your "python manage.py shell" from within your project folder? If you are, try the following: project_folder/python manage.py shell >>> from polls.models import Poll >>> dir(Poll) The above should show you that "was_published_today"

Let Django form render field's with custom attributes (e.g CSS)?

2010-03-26 Thread Thierry
Hi, I want to differentiate CSS style of fields from the style of RadioSelects elements (as rendered through RadioFieldRenderer). Immediate action: I could create my RadioFieldRenderer/RadioInput classes to display inner labels as . But (and this is mostly my point of raising the issue), I was

Re: Let Django form render field's with custom attributes (e.g CSS)?

2010-03-26 Thread Thierry
easy/lazy ways to customize attributes on a Field's , e.g for common CSS patterns where the automatically gets "required" or "error" CSS classes depending on the Field's validation options. On 26 mar, 15:28, David De La Harpe Golden wrote: > On 26/03/10

Middlewares disable for specific views

2010-04-06 Thread Thierry
Is it possible to disable a middleware such as the authentication one for specific views where they are not needed? The constant querying for messages annoys me a bit :) -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send

Django minify and combine script?

2008-02-23 Thread Thierry
Hey, I've recently made the switch from Symfony to Django. Some interesting code here :) When searching around I can't seem to find any javascript and css minifier and combiner. Can anyone recommend a good one? Cheers, Thierry --~--~-~--~~~---~--~~ Yo

SQL alchemy

2008-02-23 Thread Thierry
SQL alchemy looks really great. And there's even a plugin for Django: http://code.google.com/p/tranquil/ Does anyone here have any experience with implementing this? I was thinking of using it for the read operations only. Greetz, Th

Re: Django minify and combine script?

2008-02-25 Thread Thierry
Thanks for the 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 PROT

python singletons

2008-03-03 Thread Thierry
Implementing a singleton is slightly different in python. When you create a singleton it actually ends up remembering state across requests. I tried several on this list: http://c2.com/cgi/wiki?PythonSingleton So if i have a groups list and i append to it, for every request to the server i have e

Re: python singletons

2008-03-05 Thread Thierry
Basically the effect of implementing a singleton in php. Not sharing anything between requests. But sharing during on request. For instance you would have one javascript object, which you get through getInstance() It always returns the same object with a list of js files. Then in the view or wher

Re: How often do you update your django?

2008-03-26 Thread Thierry
Svn externals for django, so i update pretty much continously. Can't go without those sweet and new feautures :) Besides Django trunk is pretty stable --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" gro

Re: Queryset-refactor branch has been merged into trunk

2008-04-27 Thread Thierry
What's the current opinion about integrating sql alchemy into the backend of django's ORM? --~--~-~--~~~---~--~~ 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@google

django admin adding links to list view

2008-04-28 Thread Thierry
is there any way to add links to the list view in the django admin? I would like to links to some custom admin functionality, but it seems quite hard to do :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django us

get_or_create and foreign keys

2008-04-28 Thread Thierry
The get or create syntax does not appear to support the following syntax: object, created = get_or_create(entity_id = 12) it fails on the _id part. is there anyway to give it numbers instead of objects? --~--~-~--~~~---~--~~ You received this message because you

absolute url overrides

2008-05-03 Thread Thierry
ABSOLUTE_URL_OVERRIDES = { 'django.contrib.auth.models.user': lambda o: "/members/%s/" % o.username, } Doesn't seem to be working, any idea why? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" grou

Re: absolute url overrides

2008-05-04 Thread Thierry
I read that doc many times :) Missed that little detail every time though. Thanks for the 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@g

cursor.cursor.fetchall() dict version?

2008-05-04 Thread Thierry
is there a dict returning version of cursor.cursor.fetchall() ? --~--~-~--~~~---~--~~ 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 f

template translation

2008-05-25 Thread Thierry
The current template tag implementation for i18n seems a bit cumbersome and looks like it makes the template code harder to maintain. Would it be possible to code the translation logic in the template parser? Automatically extract all strings in the template code which could be translated (text b

urls.py and adding an OR to the regexp

2008-05-28 Thread Thierry
h the text capture, as it seems. I know that I still can go the dumb way ^price/ ^prices/ but if I can avoid it, I would prefer. Is there a way to get around this, or should I write one line per OR I would like to match ? Regards. Thierry. --~--~-~--~~~---~--~~ Yo

django admin - list edit in place

2008-06-15 Thread Thierry
Im a looking for an admin mode to allow the staff to edit multiple items at once. An edit in place for the standard list view would be great. Or just a list of many forms would also do. Before i start building, is there anything like this available? Greetz, Thierry

splitting up model definition, row level behaviour and table level behaviour

2008-06-15 Thread Thierry
Im looking to split the above mentioned in different files. Is there any howto on this topic? How have you implemented this? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

smart cache management

2008-06-17 Thread Thierry
Is there anything built into the cache system to manage the deletion/ invalidating of cache? All the examples seem to be based on setting a time. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. T

orm syntax

2008-06-26 Thread Thierry
Is this possible and or is there any way to simulate it? objects.order_by('date').group_by('foreign_key').having('auto_done') --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this grou

Transifex - django 1.3

2010-12-20 Thread Thierry
Whats the best way to currently setup transifex with django 1.3 The announcement says that people are working on this. Dont want to duplicate their efforts, where can i find information on this? -- You received this message because you are subscribed to the Google Groups "Django users" group. T

Using Django as dependency in an API

2015-09-17 Thread Thierry
mport or define the database backend for a module. Cheers, Thierry. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googl

order_with_respect_to fail any workaround ?

2008-12-06 Thread Thierry Stiegler
Hello, I got some errors by using the Meta options order_with_respect_to: class Category(PublicationBase, LocalisationBase): ITEM_PER_PAGE = 12 name = models.CharField(max_length=255) pictogram = models.ImageField(upload_to="categories", blank=True) old_id = models.PositiveIntege

Re: order_with_respect_to fail any workaround ?

2008-12-06 Thread Thierry Stiegler
Juste for precision I use the trunk. On Dec 6, 9:34 am, Thierry Stiegler <[EMAIL PROTECTED]> wrote: > Hello, > > I got some errors by using the Meta options order_with_respect_to: > > class Category(PublicationBase, LocalisationBase): >     ITEM_PER_PAGE = 12 >

Re: order_with_respect_to fail any workaround ?

2008-12-23 Thread Thierry Stiegler
I answer django developpers (http://groups.google.com/group/django- developers/t/280bca5001faca07) so wait and see. On 6 déc, 09:34, Thierry Stiegler wrote: > Hello, > > I got some errors by using the Meta optionsorder_with_respect_to: > > class Category(PublicationBase, L

Re: how to install django in ubuntu .........

2010-04-18 Thread Thierry Chich
What is the point ? Why aren't you using the apt-get ? Le 16 avr. 2010 à 23:38, ChrisR a écrit : Download this: http://www.djangoproject.com/download/1.1.1/tarball/ or wget http://www.djangoproject.com/download/1.1.1/tarball/ tar xzvf Django-1.1.1.tar.gz cd Django-1.1.1 sudo python setup.py

Re: code repetition in views

2010-04-18 Thread Thierry Chich
eally want to do the same thing for EVERY page. Carl On Apr 10, 11:38 pm, Thierry Chich wrote: I have written my functions as méthods of classes. Then it allow to use inheritance. Le 11 avr. 2010 à 05:58, ydjango a écrit : I find all my view method have identical code in start and i

Re: Forms with read only fields

2010-03-20 Thread Thierry Chich
only when you give rights, you could put a condition in the template I don't know if it answer to your question or if you think at something more complex. Thierry > Thanks & have a nice weekend > Peter > -- You received this message because you are subscribed to th

Re: Altering the auth_user model?

2010-03-24 Thread Thierry Chich
Le mercredi 24 mars 2010 16:53:12, Sandman a écrit : > Hi Derek, > > One way to do this would be to create a proxy model that can be used > throughout your project. > > Check out > http://docs.djangoproject.com/en/dev/topics/db/models/#proxy-models for > more info. Hi, This is what is said in o

Re: ForeignKeyField

2010-03-26 Thread Thierry Chich
Le vendredi 26 mars 2010 04:14:51, Asim Yuksel a écrit : > I have a question about model.ForeignKey field.Foreign key fields are > shown as object in admin page. How can I show them in other types like > integer type > for example I have a Model like this: > > class Advisor(models.Model): > >

Re: New User - Writing your first Django app part 1 crashed

2010-03-27 Thread Thierry Chich
Are you sure that the postgres driver of your jython is installed ? Le 27 mars 2010 à 01:52, Paul Harouff a écrit : On Fri, Mar 26, 2010 at 6:26 PM, Karen Tracey wrote: On Fri, Mar 26, 2010 at 5:58 PM, Paul Harouff wrote: I uninstalled Django development trunk and installed Django-1.1

Initializing a ModelForm don't work

2010-03-27 Thread Thierry Chich
equest.POST,instance=obj) if form.is_valid(): form.save() If some of you have an idea, I would be thanksfull. Thierry -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-

Re: Initializing a ModelForm don't work

2010-03-27 Thread Thierry Chich
Le samedi 27 mars 2010 14:39:40, Thierry Chich a écrit : > Hello all > > I have a problem to understand something. I could find some workaround > easily, but I don't want it. I want to understand. > > So this if the situation. I have a modelForm (MyModelForm) that

Re: Initializing a ModelForm don't work - BUG ?

2010-03-27 Thread Thierry Chich
rovided in data=request.POST are overwriting my domaine field. It is really curious, because request.POST doesn't contain any reference to my field domaine It's look like a bug, isn't it ? Le samedi 27 mars 2010 15:54:53, Thierry Chich a écrit : > Le samedi 27 mars 2010 14:39:40, Thie

Re: Initializing a ModelForm don't work - BUG ?

2010-03-27 Thread Thierry Chich
Le samedi 27 mars 2010 19:23:04, Daniel Roseman a écrit : > On Mar 27, 4:34 pm, Thierry Chich wrote: > > I think I get the point. > > > > If I write > > obj=MyModel() > > obj.domaine=request.session.get("domaine") > >

Re: Probably a very basic data modeling question

2010-03-28 Thread Thierry Chich
questions, you'll see that the conception of the django models is easy. Thierry Le 28 mars 2010 à 03:28, Daniel a écrit : Hi all, I'd appreciate it if you could help me out with something. I am trying to build a way to use faceted browsing through a database of biological samples. w

Re: Using ModelForm to edit ManyToMany in both directions?

2010-03-28 Thread Thierry Chich
Nice idea ! It will simplify my work. Thanks to share it ! Le 28 mars 2010 à 22:29, "pjrhar...@gmail.com" a écrit : See this snippet: http://www.djangosnippets.org/snippets/1295/ Peter On Mar 27, 6:02 am, jwils2...@gmail.com wrote: I believe the answer is to append a regular Form to th

Re: Initializing a ModelForm don't work - BUG ?

2010-03-29 Thread Thierry Chich
tting it by modifying the post > data. > > Peter > You would say : if i use an hidden form. If I exclude the field from my ModelFrom, a corrupted POST can not have an effect. I just have to set the field value in the model, and it is done, isn't it ? Thierry -- You received t

Re: How do I properly unit test a Django session?

2010-03-31 Thread Thierry Chich
7;DomaineAdmin') self.assertEqual(self.client.session.get('domaine'),d) In the last test, I am explicitely using informations stored in a session. (However, I have searched a long time before I understand that some variables was set in the accounts/accueil/ page :-( ) Thier

Re: Chained select boxes--what's my best strategy?

2010-04-01 Thread Thierry Chich
e DOM. For instance, i use the powerfull plugin datatables in order to have sortable, paginable, themable and filterable tables. I never have to use Ajax for that. I just to put some configurations, give an id to my table, and it's enough. Thierry Le 2 avr. 2010 à 07:22, Daniel a éc

User and additionnal fields

2010-04-02 Thread Thierry Chich
,'user') class UtilisateurModelForm(UserModelForm,UtilisateurOnlyModelForm): pass This a little bit boring because it will avoid me to rewrite some of my generic model view if I could have all the data I need in just one Form. Is it a simple way to do that ? Thierry, -- You received t

Re: Model inheritance foreign key user

2010-04-03 Thread Thierry Chich
is documented, but i don't remember where exactly. Thierry Le 3 avr. 2010 à 20:38, Fredrik a écrit : Hi, I want to use it like this: """ class PersistentModel(models.Model): deleted = models.BooleanField(default = False) date_created = models.DateTimeField(

Re: Model inheritance foreign key user

2010-04-03 Thread Thierry Chich
rs ?). Now it work with a simple authorization function applied on the queryset when i populate my forms. Thierry Fredrik On Apr 3, 10:48 pm, Thierry Chich wrote: I think that if you want make inheritance it is because you want to have others subclasses. But then, your related name

Re: Model inheritance foreign key user

2010-04-04 Thread Thierry Chich
You are right but it would not change his problem. If 2 or more classes inherit from a class with a foreignkey or a manytomany, there will be a conflict in the related name Le 4 avr. 2010 à 14:11, Daniel Roseman a écrit : On Apr 3, 10:37 pm, Fredrik wrote: What I want is to "automat

Re: Tricky problem: database tables are not created

2010-04-05 Thread Thierry Chich
Is manage.py sqlall working ? Le 5 avr. 2010 à 14:03, Torsten Bronger aachen.de> a écrit : Hallöchen! Torsten Bronger writes: [...] But it gets even more strange: The models module of "chantal_ipv" imports models from "samples". I think this is the problem. If I comment out all calls t

Re: set up database engine

2010-04-08 Thread Thierry CHICH
Perhaps are you confused because of SQLlite. You need to know that SQLite is not a classical database with a server that you need to install. An sqlite database is only a file stored where do you want. Thierry > I mean the tutorial only tells you "edit settings" but doesn

Re: set up database engine

2010-04-08 Thread Thierry Chich
10 à 05:58, yangyang a écrit : Hi Thierry, Thanks for the reply. I understand what SQLight is but I don't know how to write the code in my Mac shell... This is what I wrote: yang-wangs-computer:~/applications/mysite yangwang$ database_engine='sqlite3' yang-wangs-computer:~/app

Re: code repetition in views

2010-04-10 Thread Thierry Chich
I have written my functions as méthods of classes. Then it allow to use inheritance. Le 11 avr. 2010 à 05:58, ydjango a écrit : I find all my view method have identical code in start and in end: anyway to avoid repetition...? Example: def typical_view_method(request): Check if user i

Re: Request to the list owner

2010-04-12 Thread Thierry CHICH
> On Mon, Apr 12, 2010 at 1:58 PM, Omer Barlas wrote: > > Can you please add a prefix to the email subject? I am reading my mail > > mostly from my BB Bold, but I cannot filter mail like Thunderbird > > does, it would be much simpler if there was a prefix like [django] or > > such. > It is tru

Re: urls.py and adding an OR to the regexp

2008-05-28 Thread Thierry Schork
on't capture use "?:" to flag it > as non-grouping. So instead try: > > ^pric(?:e|es)/ Perfect ! Thank you very much Matt. Regards. Thierry. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: urls.py and adding an OR to the regexp

2008-05-28 Thread Thierry Schork
xing them up... Not that I will integrate an URL matching like that one, but for the sake of the example (or is it exemple ?? I'm never sure...) > > On May 28, 3:15 am, "Thierry Schork" <[EMAIL PROTECTED]> wrote: > > > > It's simply an OR done into the match

  1   2   >