Re: Django-like PHP framework?

2009-01-05 Thread makoto tsuyuki
How about rhaco? http://translate.google.com/translate?hl=en&ie=UTF-8&u=http%3A%2F%2Frhaco-users.jp%2F&sl=ja&tl=en&history_state0= rhaco has... * Template Inheritance * Model based validation * URLMapper * admin * doctest * Made in Japan...(No english document) openpear, Japanese Pear Channel,

Re: Shouldn't blank=True imply null=True?

2009-01-05 Thread Jeff Anderson
Malcolm Tredinnick wrote: > On Mon, 2009-01-05 at 23:39 -0700, Jeff Anderson wrote: > >> Malcolm Tredinnick wrote: >> >>> The way to think about this problem is whether there's a situation where >>> blank=True, null=False makes sense or is even possible for non-text >>> fields and Mike quit

Re: Shouldn't blank=True imply null=True?

2009-01-05 Thread Malcolm Tredinnick
On Mon, 2009-01-05 at 23:39 -0700, Jeff Anderson wrote: > Malcolm Tredinnick wrote: > > The way to think about this problem is whether there's a situation where > > blank=True, null=False makes sense or is even possible for non-text > > fields and Mike quite possibly has a valid point there: you c

Re: Shouldn't blank=True imply null=True?

2009-01-05 Thread Jeff Anderson
Malcolm Tredinnick wrote: > The way to think about this problem is whether there's a situation where > blank=True, null=False makes sense or is even possible for non-text > fields and Mike quite possibly has a valid point there: you cannot store > a blank value in a non-NULL integer field, for exam

Re: Access Control Lists implementation for Django?

2009-01-05 Thread Mir Nazim
Thanks guys Will check out both. And let you know my reactions On Tue, Jan 6, 2009 at 1:16 AM, bruno desthuilliers wrote: > > On 5 jan, 10:55, "Mir Nazim" wrote: >> Hello Guys >> >> I was wondering that is there any 3rd party ACL implementation for >> django. Django's permission system is a bi

Django forms usage with mutliple rows

2009-01-05 Thread Kottiyath Nair
Hi, Since I am a newbie in HTML and Django, there might be a completely different way to do this. If somebody can point that also, it would be helpful. I want to send multiple rows of data from a datagrid to a django server. Currently, I am doing it in a single form inside a page with

Re: Django-like PHP framework?

2009-01-05 Thread Dave Dash
I did a lot of symfony stuff on the side about a year ago, and now it's the framework that I we use for our frontend servers at Delicious.com. It was through symfony that I found out about Django, and started using it quite a bit... so I know a bit about the two frameworks. Or rather, I know a l

Import models from CSV files?

2009-01-05 Thread Victor Hooi
heya, This question might seem a bit simple, but what's the best way to instantiate models from .csv files? Essentially, I have two .csv files. One contains a list of people, and their access rights (one-to-many). The second .csv file contains a log of doorway access (just a bunch of sequential

Re: Shouldn't blank=True imply null=True?

2009-01-05 Thread Malcolm Tredinnick
On Tue, 2009-01-06 at 07:58 +0530, Kenneth Gonsalves wrote: > On Tuesday 06 Jan 2009 12:50:24 am Mike wrote: > > If the type is not a string, and blank=True is set, shouldn't > > null=True be implied? > > no - blank=True is enforced at django level whereas null=True is enforced at > DB level and

Re: Do you recommend "Practical Django Projects"?

2009-01-05 Thread Ben
I recently read both and went thru all the examples in Pracitical Django Projects. It was a bit tough at first because some of it is a little dated, but actually figuring out how to adapt it to 1.0 is actually a good exercise in itself (learning how to debug and actually understanding how things

Re: Shouldn't blank=True imply null=True?

2009-01-05 Thread Kenneth Gonsalves
On Tuesday 06 Jan 2009 12:50:24 am Mike wrote: > If the type is not a string, and blank=True is set, shouldn't > null=True be implied? no - blank=True is enforced at django level whereas null=True is enforced at DB level and blank != null. -- regards KG http://lawgon.livejournal.com --~--~---

Re: Change name of imagefield files before they are saved

2009-01-05 Thread garagefan
I may be able to offer some assistance here :) i used the follow bit to create a thumbnail image and changed the name of the file to include _tn. def save(self): super(ImageUpload, self).save() if self.image: tsize = 150,150 path = settings.MEDIA_ROOT + self

Change name of imagefield files before they are saved

2009-01-05 Thread geirr
Hello! I'm trying to make a simple photo album application. I can't figure out how to change the name of photos that are uploaded to something different than the name they have locally on my computer. I want to give the files new names, before they are saved. I am using the ImageField model fiel

Re: Newb needs help with tracking variables in Templates

2009-01-05 Thread Daniel Roseman
On Jan 5, 5:39 pm, "django_fo...@codechimp.net" wrote: > I have a pretty simple template that needs to print some data in a > bunch of table rows.  I have done something like this: > > > {% if my_art_list %} >         {% count = 0 %} >         {% for art in my_art_list %} >                 {% if

Re: Newb needs help with tracking variables in Templates

2009-01-05 Thread django_fo...@codechimp.net
On Jan 5, 5:56 pm, bruno desthuilliers wrote: > On 5 jan, 23:39, "django_fo...@codechimp.net" > wrote: > > > I have a pretty simple template that needs to print some data in a > > bunch of table rows.  I have done something like this: > > > > > {% if my_art_list %} > >         {% count = 0 %}

Newb needs help with tracking variables in Templates

2009-01-05 Thread django_fo...@codechimp.net
I am very new to Django and Python. I have been working on a pet project that has a table of rows. My thought was to have a counter in the template, and use modulus to write out the row start/stops out. The code looks like this: {% if my_art_list %} {% count = 0 %} {% for art i

Re: django and database views

2009-01-05 Thread drakkan
On 6 Gen, 00:41, drakkan wrote: > On 6 Gen, 00:32, Malcolm Tredinnick wrote: > > > > > On Mon, 2009-01-05 at 06:31 -0800, drakkan wrote: > > > however if i delete an user with records associated in the view I have > > > this error: > > > > NotSupportedError: cannot delete from a view > > > HIN

Re: Is there an easy way to test ssl protected pages in development server??

2009-01-05 Thread Graham Dumpleton
On Jan 6, 3:02 am, madhav wrote: > Is there an easy way to test ssl protected pages in development > server? Normally I will be doing the testing by accessing the same > urls with http and not https in dev server. Is this the only way? You may be better of setting up a instance of Apache with

Re: Redirect User on First Log In

2009-01-05 Thread Eric Abrahamsen
On Jan 6, 2009, at 6:41 AM, Aruna wrote: > > I'm trying to redirect a user on their first log in, to a special > welcome page. Subsequent logins will go to a regular page. Is there a > way to do that in the templates? Does Django have a way to check if > it's a users first login? User instances

Re: File upload failing occasionally

2009-01-05 Thread Karen Tracey
On Mon, Jan 5, 2009 at 5:30 PM, ppdo wrote: > > I tried to monitor the interface using WireShark and the communication > just hangs during a data transfer: Apache is just acknowledging the > receipt of some packets and then just seems to hang. The suspicious > bit is a fairly long series of http

Re: Port large webapp from PHP to Django: tips, experiences, links needed

2009-01-05 Thread Alexey Moskvin
Hello! Perhaps, there is no answers to your questions because of some of them are already discussed here and in other django-related places (like cache perfomance e t.c.), some of them are closed to holywar :) (like to use or not to use of the ORM), and some of them like "How about Django in that

Re: birth date in a model form

2009-01-05 Thread DragonSlayre
Oh, cool thanks :) I never went into the code part of djangoproject before, always just the documentation. That's great, thanks. On Jan 6, 12:53 pm, Brot wrote: > from django import forms > from django.forms.extras import widgets > > class FiremanForm(forms.ModelForm): >     birth_date = forms

Re: license problem

2009-01-05 Thread Malcolm Tredinnick
On Mon, 2009-01-05 at 23:46 +0100, Sebastian Bauer wrote: > Hello, i want to release some code, but i have one problem: > > how impel peoples to send me back patches? You can't really force that with any existing Open Source license. They aren't designed to force people to support the original a

Re: Does PhoneNumberField for models exist?

2009-01-05 Thread Malcolm Tredinnick
On Tue, 2009-01-06 at 10:45 +1100, Malcolm Tredinnick wrote: > On Mon, 2009-01-05 at 14:33 -0800, DragonSlayre wrote: > > http://docs.djangoproject.com/en/dev/topics/forms/modelforms/ > > > > This lists PhoneNumberField as being a field type, but in the models > > documentation, > > http://docs.

Re: birth date in a model form

2009-01-05 Thread Brot
from django import forms from django.forms.extras import widgets class FiremanForm(forms.ModelForm): birth_date = forms.DateField(widget=widgets.SelectDateWidget()) On Jan 6, 12:11 am, DragonSlayre wrote: > I've tried using it, but I'm still quite new to django - I put it into > my model fi

Re: Does PhoneNumberField for models exist?

2009-01-05 Thread DragonSlayre
Thanks :) On Jan 6, 12:46 pm, "Karen Tracey" wrote: > On Mon, Jan 5, 2009 at 5:33 PM, DragonSlayre wrote: > > >http://docs.djangoproject.com/en/dev/topics/forms/modelforms/ > > > This lists PhoneNumberField as being a field type, but in the models > > documentation, > >http://docs.djangoproject

Re: Does PhoneNumberField for models exist?

2009-01-05 Thread Karen Tracey
On Mon, Jan 5, 2009 at 5:33 PM, DragonSlayre wrote: > > http://docs.djangoproject.com/en/dev/topics/forms/modelforms/ > > This lists PhoneNumberField as being a field type, but in the models > documentation, > http://docs.djangoproject.com/en/dev/ref/models/fields/#ref-models-fields > there is no

Re: Does PhoneNumberField for models exist?

2009-01-05 Thread Malcolm Tredinnick
On Mon, 2009-01-05 at 14:33 -0800, DragonSlayre wrote: > http://docs.djangoproject.com/en/dev/topics/forms/modelforms/ > > This lists PhoneNumberField as being a field type, but in the models > documentation, > http://docs.djangoproject.com/en/dev/ref/models/fields/#ref-models-fields > there is

Re: django discarding MySQL results for "in" operator

2009-01-05 Thread Malcolm Tredinnick
On Mon, 2009-01-05 at 12:37 -0800, JonUK wrote: [...] > I'm using django 1.0.2 and the tagging app to retrieve a tag via a > database "in" query, and something is causing the query results to be > discarded. > > In particular, this line of code from tagging.utils.get_tag_list() > executes: > > r

Re: django and database views

2009-01-05 Thread drakkan
On 6 Gen, 00:32, Malcolm Tredinnick wrote: > On Mon, 2009-01-05 at 06:31 -0800, drakkan wrote: > > however if i delete an user with records associated in the view I have > > this error: > > > NotSupportedError: cannot delete from a view > > HINT:  You need an unconditional ON DELETE DO INSTEAD

Re: IOError: request data read error

2009-01-05 Thread Graham Dumpleton
On Jan 6, 4:41 am, Chunlei Wu wrote: > Hi, > >        We have a web app running on Django 1.0 / modwsgi 2.0 / Apache Latest mod_wsgi is 2.3, you should really think about upgrading. :-) > 2.2.3. Sparsely, about 2~3 times a week, I receive emails about > IOError as below: > > ... >   File "/p

Re: django discarding MySQL results for "in" operator

2009-01-05 Thread Karen Tracey
On Mon, Jan 5, 2009 at 3:37 PM, JonUK wrote: > > Apologies as this is a repost, but I'm completely stuck! > > I'm using django 1.0.2 and the tagging app to retrieve a tag via a > database "in" query, and something is causing the query results to be > discarded. > > In particular, this line of cod

Re: django and database views

2009-01-05 Thread Malcolm Tredinnick
On Mon, 2009-01-05 at 06:31 -0800, drakkan wrote: > however if i delete an user with records associated in the view I have > this error: > > NotSupportedError: cannot delete from a view > HINT: You need an unconditional ON DELETE DO INSTEAD rule. > > django try to delete record from the view a

Re: license problem

2009-01-05 Thread Russell Keith-Magee
On Tue, Jan 6, 2009 at 7:46 AM, Sebastian Bauer wrote: > > Hello, i want to release some code, but i have one problem: > > how impel peoples to send me back patches? > > Any suggestions are welcome :) First, participate in the dark arts until to ascend to the level of minor god. Then, use your n

Re: File upload failing occasionally

2009-01-05 Thread Graham Dumpleton
On Jan 6, 9:30 am, ppdo wrote: > I tried to monitor the interface using WireShark and the communication > just hangs during a data transfer: Apache is just acknowledging the > receipt of some packets and then just seems to hang. The suspicious > bit is a fairly long series of http RST about 20m

Re: Distinct users ordered by remote field

2009-01-05 Thread Malcolm Tredinnick
On Mon, 2009-01-05 at 04:42 -0800, coan wrote: > I have a model that looks something like this: > > class Collection(models.Model): > user = models.ForeignKey(User) > item = models.ForeignKey(Items) > date = models.DateTimeField() > > I'm trying to retrieve a list of unique users ordered by t

Re: django and database views

2009-01-05 Thread Russell Keith-Magee
On Tue, Jan 6, 2009 at 8:11 AM, drakkan wrote: > > > > On 6 Gen, 00:06, "Russell Keith-Magee" wrote: >> On Mon, Jan 5, 2009 at 11:31 PM, drakkan wrote: >> >> > Hi all, >> >> > I mapped a database view in django model as a normal database table, >> ... >> > there is a know workaround for this? a

Re: to understand MEDIA_URL

2009-01-05 Thread Alan
Thanks Mark for your reply. On Mon, Jan 5, 2009 at 14:25, Mark Jones wrote: > > Are you closing the file after you write to it and before you try to > send it? Pretty sure about it. In fact, after try and error I found out that restarting the server and my static folder gets refreshed and awar

Re: django and database views

2009-01-05 Thread drakkan
On 6 Gen, 00:06, "Russell Keith-Magee" wrote: > On Mon, Jan 5, 2009 at 11:31 PM, drakkan wrote: > > > Hi all, > > > I mapped a database view in django model as a normal database table, > ... > > there is a know workaround for this? any way to declare read only the > > model? > > In short, no.

Re: birth date in a model form

2009-01-05 Thread DragonSlayre
I've tried using it, but I'm still quite new to django - I put it into my model file for now, and made my model form looks like this: class FiremanForm(ModelForm): birth_date = models.DateField(widget=SelectDateWidget()) But I get an error "got an unexpected keyword argument 'widget' " >From

Re: django and database views

2009-01-05 Thread Russell Keith-Magee
On Mon, Jan 5, 2009 at 11:31 PM, drakkan wrote: > > Hi all, > > I mapped a database view in django model as a normal database table, ... > there is a know workaround for this? any way to declare read only the > model? In short, no. Django doesn't currently provide any support for database views.

Re: StringList Field Type

2009-01-05 Thread bruno desthuilliers
On 5 jan, 22:52, "Tiago S." wrote: > Hi Bruno, > > > Then how do you store the number of votes per choice ? > > My app is really a quiz with 5 answers per Question and multiples > Question per Quiz. I used the Poll analogy to make easier to explain > what I really need, as the django tutorial is

Re: Redirect parent from within iframe without losing session

2009-01-05 Thread Berco Beute
This one still has me flabbergasted. It may be a browser restriction (firefox 3), but there is no way I can have the iFrame redirect the parent page to another page in the same domain (as the previous parent page) without invalidating the session. Is there maybe another common solution for iFrames

Re: Newb needs help with tracking variables in Templates

2009-01-05 Thread bruno desthuilliers
On 5 jan, 23:39, "django_fo...@codechimp.net" wrote: > I have a pretty simple template that needs to print some data in a > bunch of table rows. I have done something like this: > > > {% if my_art_list %} > {% count = 0 %} This just won't work > {% for art in my_art_list %} >

license problem

2009-01-05 Thread Sebastian Bauer
Hello, i want to release some code, but i have one problem: how impel peoples to send me back patches? Any suggestions are welcome :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to

Redirect User on First Log In

2009-01-05 Thread Aruna
I'm trying to redirect a user on their first log in, to a special welcome page. Subsequent logins will go to a regular page. Is there a way to do that in the templates? Does Django have a way to check if it's a users first login? --~--~-~--~~~---~--~~ You received

Newb needs help with tracking variables in Templates

2009-01-05 Thread django_fo...@codechimp.net
I have a pretty simple template that needs to print some data in a bunch of table rows. I have done something like this: {% if my_art_list %} {% count = 0 %} {% for art in my_art_list %} {% if count%3 = 0 %} {% endif %}

Shouldn't blank=True imply null=True?

2009-01-05 Thread Mike
Hi. Hopefully this has a quick answer; I tried searching the list but didn't come up with an answer. Context: I'm extending django.contrib.auth.models.User with some extra fields, for instance IntegerField() and ForeignKey(). For non-string fields, whenever you use blank=True you also currently

Re: Port large webapp from PHP to Django: tips, experiences, links needed

2009-01-05 Thread Berco Beute
Still looking for some feedback. :) In the meantime I've collected a few links that might be useful for others with the same questions: http://www.egenix.com/library/presentations/EuroPython2008-Designing-Large-Scale-Applications-in-Python/ http://highscalability.com/ebay-architecture http://high

Does PhoneNumberField for models exist?

2009-01-05 Thread DragonSlayre
http://docs.djangoproject.com/en/dev/topics/forms/modelforms/ This lists PhoneNumberField as being a field type, but in the models documentation, http://docs.djangoproject.com/en/dev/ref/models/fields/#ref-models-fields there is no such field. Does anybody know if this field exists? I'd quite l

Re: File upload failing occasionally

2009-01-05 Thread ppdo
I tried to monitor the interface using WireShark and the communication just hangs during a data transfer: Apache is just acknowledging the receipt of some packets and then just seems to hang. The suspicious bit is a fairly long series of http RST about 20ms before the server hangs. Though I'm not

Re: birth date in a model form

2009-01-05 Thread Brot
Hello, I have the same issue in my app and there is a widget. You can find it here: http://code.djangoproject.com/browser/django/trunk/django/forms/extras/widgets.py But for me this widget misses a few features and there are open tickets with patches, but they are not in trunk yet :-( http://cod

Re: exception while rendering: 'utf8' codec can't decode byte 0x92 in position 2911

2009-01-05 Thread adrian
Answering myself, there was an illegal character in site_base.html . On Jan 5, 3:30 pm, adrian wrote: > I'm getting this message on line 1 of the template: > > {% extends "site_base.html" %} > > Which looks ok to me.   I got this while refactoring things. > Pretty sure the template was working a

birth date in a model form

2009-01-05 Thread DragonSlayre
Hi, I've got a ModelForm, and the model for it contains a birth date field (as a DateField): class FiremanForm(ModelForm): class Meta: model = Fireman Currently a single text box is rendered to enter the date, but I'd like to have a drop down list for day, month, year. I'm guessing

Re: StringList Field Type

2009-01-05 Thread Tiago S.
Hi Bruno, > > Then how do you store the number of votes per choice ? > My app is really a quiz with 5 answers per Question and multiples Question per Quiz. I used the Poll analogy to make easier to explain what I really need, as the django tutorial is about a Poll app. > > Overkill, nope. But ho

exception while rendering: 'utf8' codec can't decode byte 0x92 in position 2911

2009-01-05 Thread adrian
I'm getting this message on line 1 of the template: {% extends "site_base.html" %} Which looks ok to me. I got this while refactoring things. Pretty sure the template was working as is in another location. Any idea how I can debug this, I have no clue. --~--~-~--~~~

Re: manage.py test without using a database?

2009-01-05 Thread Bo Shi
Thanks Russell, the former works great (I was hoping, in my infinite laziness, that there was an undocumented command line switch :-P). Regards, Bo On Jan 1, 1:50 am, "Russell Keith-Magee" wrote: > On Wed, Dec 31, 2008 at 7:08 AM, Bo Shi wrote: > > > Hi, > > > One of our django applications do

Re: request.FILES always empty

2009-01-05 Thread Marc Boivin
Thank you On Mon, Jan 5, 2009 at 3:39 PM, Alex Koshelev wrote: > > You don't set proper `enctype` to the form [1] > > [1]: > http://docs.djangoproject.com/en/dev/ref/forms/api/#binding-uploaded-files-to-a-form > > > On Mon, Jan 5, 2009 at 11:34 PM, Glimps wrote: > > > > I'm using ModelForm to r

Re: request.FILES always empty

2009-01-05 Thread Alex Koshelev
You don't set proper `enctype` to the form [1] [1]: http://docs.djangoproject.com/en/dev/ref/forms/api/#binding-uploaded-files-to-a-form On Mon, Jan 5, 2009 at 11:34 PM, Glimps wrote: > > I'm using ModelForm to render my form. I have a FileField in my model > that shows up as a type="file" on

django discarding MySQL results for "in" operator

2009-01-05 Thread JonUK
Apologies as this is a repost, but I'm completely stuck! I'm using django 1.0.2 and the tagging app to retrieve a tag via a database "in" query, and something is causing the query results to be discarded. In particular, this line of code from tagging.utils.get_tag_list() executes: return Tag.ob

request.FILES always empty

2009-01-05 Thread Glimps
I'm using ModelForm to render my form. I have a FileField in my model that shows up as a type="file" on my page. Thing is, even if I select a file to upload Django always complains about the field being empty and my form never validates. Here's my model: class IOs(models.Model): name

Re: Do you recommend "Practical Django Projects"?

2009-01-05 Thread waltbrad
On Jan 5, 3:21 am, HB wrote: > Hey, > I'm reading "The Definitive Guide To Django" but it is too out dated. > Do you recommend "Practical Django Projects" instead? > It seems to me that "The Definitive Guide To Django" is more organized > and covers a lot of materials. > What do you think? > Th

Re: Dynamic OR statements

2009-01-05 Thread bruno desthuilliers
On 5 jan, 18:09, "alex.gay...@gmail.com" wrote: > You need to build up the Q object and then filter on it so: > results = RelatedModel.objects.all() > q = Q() > for category in category_list: > q |= Q(categories__slug = category.slug) > results = results.filter(q) Or create a sequence of Q

Re: Same form with dropdown on all pages

2009-01-05 Thread ydjango
Thanks I will look into that. I am thinking may decorators can also help. having 2 html forms on one page is turning out to be very tricky. On Jan 4, 3:16 pm, Justin Myers wrote: > It sounds like you're after a custom template > tag:http://docs.djangoproject.com/en/dev/howto/custom-template-

Re: Outdated data in django page rendering w/ cacheing disabled

2009-01-05 Thread Malinka Rellikwodahs
On Fri, Jan 2, 2009 at 09:56, Rajesh Dhawan wrote: >> >> As far as I can tell there is no reason for this data to be outdated >> on browser refresh, I've tried looking through the documentation and >> other places to find what could be causing this > > You didn't include a code snippet of how you

Re: StringList Field Type

2009-01-05 Thread bruno desthuilliers
On 5 jan, 19:25, "Tiago S." wrote: > Hi, > > I'm porting a app from GAE, which uses the StringList[1] property to > store choices(simple strings) in the Poll model. > > I've read the django tutorial and there they make use of two models > with a relationship between Choices and Polls. This is th

Re: Access Control Lists implementation for Django?

2009-01-05 Thread bruno desthuilliers
On 5 jan, 10:55, "Mir Nazim" wrote: > Hello Guys > > I was wondering that is there any 3rd party ACL implementation for > django. Django's permission system is a bit limited for the app we are > working on. > Actually, a per object access control is needed. There's a granular_permissions app, bu

Re: Do you recommend "Practical Django Projects"?

2009-01-05 Thread Margie
I was a total web framework newbie and got started with the SAMS book. I think it's called "learn Django in 24 hours" or something like that. It has a ton of errors and from that standpoint, it not a good book. However, it is the only book I've found that really leads you step by step through c

Re: Permissions: is something wrong with them?

2009-01-05 Thread Artem Skvira
Can I get Russell's comment on that? On Jan 2, 6:26 pm, Artem Skvira wrote: > Well, > > it's not the usage I'm not clear on but rather architecture. > Would anyone be able to comment on the issues raised? > > Thanks > > On Jan 2, 2:20 pm, Jeff Anderson wrote: > > >ArtemSkvira wrote: > > > Is it

Re: Access Control Lists implementation for Django?

2009-01-05 Thread Ramdas S
Perhaps this will give you some ideas http://www.b-list.org/weblog/2008/dec/24/admin/ On Mon, Jan 5, 2009 at 3:25 PM, Mir Nazim wrote: > > Hello Guys > > I was wondering that is there any 3rd party ACL implementation for > django. Django's permission system is a bit limited for the app we are

Re: Do you recommend "Practical Django Projects"?

2009-01-05 Thread Benjamin Buch
I agree, Practical Django Projects is a great book! Altough I would only recommend it if you've read the docs and worked you way through the tutorial (which are both excellent as someone mentioned earlier...) It's full of best practices and a lot of bits and pieces that are not covered by th

StringList Field Type

2009-01-05 Thread Tiago S.
Hi, I'm porting a app from GAE, which uses the StringList[1] property to store choices(simple strings) in the Poll model. I've read the django tutorial and there they make use of two models with a relationship between Choices and Polls. With my app, I don't see the need of an extra model, as a s

IOError: request data read error

2009-01-05 Thread Chunlei Wu
Hi, We have a web app running on Django 1.0 / modwsgi 2.0 / Apache 2.2.3. Sparsely, about 2~3 times a week, I receive emails about IOError as below: Traceback (most recent call last): File "/projects/prod/python/2.5.1/lib/python2.5/site-packages/django/ core/handlers/base.py", line 86,

Re: Django-like PHP framework?

2009-01-05 Thread Masklinn
On 5 Jan 2009, at 14:31 , thi.l...@gmail.com wrote: > Hi, > > I have a hard time getting Django adopted as web framework in the > office. > Mostly because the boss paid for PHP-based trainings, and our current > infrastructure leaves little room for mod_python/wsgi/fastcgi... > > I was wondering i

Re: Dynamic OR statements

2009-01-05 Thread Enrico
Hi Mark, I think you could use the Q object like this: q_filter = Q() for category in category_list: q_filter = q_filter | Q(categories__slug=category.slug) results = RelatedModel.objects.filter(q_filter) Best regards, Enrico --~--~-~--~~~---~--~~ You receive

Re: Dynamic OR statements

2009-01-05 Thread alex.gay...@gmail.com
You need to build up the Q object and then filter on it so: results = RelatedModel.objects.all() q = Q() for category in category_list: q |= Q(categories__slug = category.slug) results = results.filter(q) On Jan 5, 10:52 am, Bluemilkshake wrote: > Hello. Django noob here, pretty much. > > I

Re: Dynamic OR statements

2009-01-05 Thread Ronny Haryanto
On Mon, Jan 5, 2009 at 11:59 PM, Ronny Haryanto wrote: > On Mon, Jan 5, 2009 at 11:52 PM, Bluemilkshake > wrote: >> for category in category_list: >>results = results.filter(categories__slug = category.slug) > > How about results.filter(category__in=category_list)? Whoops. Never mind. Repli

Re: inlineformset_factory KeyError after updating

2009-01-05 Thread Alistair Marshall
2009/1/5 Alistair Marshall : Upgraded to 1.0.2 I'll try and create a cut down version-that may take some time (it is getting to be a large project) Thanks -- Alistair Marshall www.thatscottishengineer.co.uk --~--~-~--~~~---~--~~ You received this message becau

Re: Dynamic OR statements

2009-01-05 Thread Ronny Haryanto
On Mon, Jan 5, 2009 at 11:52 PM, Bluemilkshake wrote: > for category in category_list: >results = results.filter(categories__slug = category.slug) How about results.filter(category__in=category_list)? Ronny --~--~-~--~~~---~--~~ You received this message bec

Dynamic OR statements

2009-01-05 Thread Bluemilkshake
Hello. Django noob here, pretty much. I understand how one can use Q objects to construct OR statements within a QuerySet, but (how) is it possible to do this dynamically? I have a list of categories, and I want to find items that match ANY of those categories. The current solution doesn't work

Re: inlineformset_factory KeyError after updating

2009-01-05 Thread Karen Tracey
On Mon, Jan 5, 2009 at 11:33 AM, Alistair Marshall < runninga...@googlemail.com> wrote: > > 2009/1/5 Karen Tracey : > > First, I would try 1.0.2 release or current trunk or 1.0.X branch instead > of > > 1.0. There have been additional fixes in this area that you may need, > > depending on what yo

Re: unbalanced parenthesis

2009-01-05 Thread mangamonk
thank you! On Jan 5, 4:32 pm, "Alex Koshelev" wrote: > You've forgotten ")" after `(?P\d{4}` > > On Mon, Jan 5, 2009 at 7:30 PM, mangamonk wrote: > > > I'm trying to complete the practical django applications tutorial.. > > > error at /weblog/ > > unbalanced parenthesis > > Request Method:    

Re: Migrating MySQL -> Postgre, any working solutions?

2009-01-05 Thread Szymon
On 4 Sty, 20:23, tofer...@gmail.com wrote: > On 03.01-02:10, Szymon wrote: > 3.      you will need to substitute quotation marks, mysql uses "" > and postgresql uses \".  good old 'sed' to the rescue here. This is not only difference - MySQL uses 0/1 for BooleanField, Postgres t/f. After two day

Re: inlineformset_factory KeyError after updating

2009-01-05 Thread Alistair Marshall
2009/1/5 Karen Tracey : > First, I would try 1.0.2 release or current trunk or 1.0.X branch instead of > 1.0. There have been additional fixes in this area that you may need, > depending on what you are doing. > Just upgraded now - no difference > If that doesn't fix it, please post some specifi

Re: unbalanced parenthesis

2009-01-05 Thread Alex Koshelev
You've forgotten ")" after `(?P\d{4}` On Mon, Jan 5, 2009 at 7:30 PM, mangamonk wrote: > > I'm trying to complete the practical django applications tutorial.. > > error at /weblog/ > unbalanced parenthesis > Request Method: GET > Request URL:http://127.0.0.1:8000/weblog/ > Exception

unbalanced parenthesis

2009-01-05 Thread mangamonk
I'm trying to complete the practical django applications tutorial.. error at /weblog/ unbalanced parenthesis Request Method: GET Request URL:http://127.0.0.1:8000/weblog/ Exception Type: error Exception Value:unbalanced parenthesis /home/mark/django_projects/coltrane

Re: Do you recommend "Practical Django Projects"?

2009-01-05 Thread Peter Herndon
"Practical Django Projects" is a bit dated at the moment -- Django has been moving very quickly. However, there's a lot to learn from it, particularly regarding structuring your applications to be reusable, and lots of other best practices. I'm in the middle of "Python Web Development with Djang

Re: Inheritance question

2009-01-05 Thread carlopires
Ok looks reazonable. But be something like: p = Person(name='test') s = Student(person=p, course='test course') or s = Student(parent=p) is desirable and easy to implement a copy data from Person instance to Student. On Jan 3, 1:02 am, Malcolm Tredinnick wrote: > On Fri, 2009-01-02 at 16:29

Is there an easy way to test ssl protected pages in development server??

2009-01-05 Thread madhav
Is there an easy way to test ssl protected pages in development server? Normally I will be doing the testing by accessing the same urls with http and not https in dev server. Is this the only way? --~--~-~--~~~---~--~~ You received this message because you are subsc

Re: Comments Framework and Authentication

2009-01-05 Thread Tim
Maybe a little brevity is in order - how do I grant temporary privileges to a user to delete a comment rather than keeping that power fully in the hands of a comments moderator? - Tim On Jan 3, 7:23 pm, Tim wrote: > Hi all - > > I am having a bit of difficulty with the Django comments framework

Re: FileSystemStorage content vs PIL Image - **Initial solution**

2009-01-05 Thread Donn
On Monday, 05 January 2009 17:50:09 A Melé wrote: > Donn, take a look at django-thumbs source code Many thanks -- it looks familiar now :) \d --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: FileSystemStorage content vs PIL Image - **Initial solution**

2009-01-05 Thread A Melé
Donn, take a look at django-thumbs source code, it integrates PIL and SotrageBackend: http://code.google.com/p/django-thumbs/source/browse/trunk/thumbs.py I hope the code helps you. Regards, Antonio Melé http://django.es/blog/ On 5 ene, 13:30, Donn wrote: > On Monday, 05 January 2009 14:00:

Re: inlineformset_factory KeyError after updating

2009-01-05 Thread Karen Tracey
On Mon, Jan 5, 2009 at 10:01 AM, Alistair Marshall < runninga...@googlemail.com> wrote: > > I appear to be having the same trouble as explained in a previous > thread [1] (and for some reason cant find the button to reply to the > last thread ???) > > The other thread points to a bug that was fixe

Re: Backward relation to a subclass in multi-table inheritance

2009-01-05 Thread Torsten Bronger
Hallöchen! Carsten Reimer writes: > [...] > > This resulted in instances of class B being returned (which is > probably logical) but I wanted to get the class C-instances. What > I might be able to do, given the instances of class B as shown > before, I might loop over them and get the related c

Backward relation to a subclass in multi-table inheritance

2009-01-05 Thread Carsten Reimer
Dear all, I ran into a problem with the following situation: Given are three models as follows: class A(models.Model): # some sensible fields an methods here class B(models.Model): fk = models.ForeignKey(A) # some more stuff here class C(B) # some sensible different fie

inlineformset_factory KeyError after updating

2009-01-05 Thread Alistair Marshall
I appear to be having the same trouble as explained in a previous thread [1] (and for some reason cant find the button to reply to the last thread ???) The other thread points to a bug that was fixed before django 1.0 (which is what I am running) I am not (intentionally) doing anything funny wit

Re: Do you recommend "Practical Django Projects"?

2009-01-05 Thread brad
On Jan 5, 2:21 am, HB wrote: > Do you recommend "Practical Django Projects" instead? I got this book as soon as it came out, and very soon after Django hit 1.0. It's a good book, and I learned a few "big picture" ideas from the sample apps, but I really had to read the docs to figure out how t

django and database views

2009-01-05 Thread drakkan
Hi all, I mapped a database view in django model as a normal database table, all seems fine and I'm able to follow foreign key too, here is a sample class databaseview(models.Model): field1= user=models.ForeignKey(User) however if i delete an user with re

Re: Django-like PHP framework?

2009-01-05 Thread Емил Иванов / Emil Ivanov
Welding together Zend Framework, Doctrine and PHPUnit can give you a very good stack to work with. All 3 frameworks are very advanced. You won't get stuff like automatic model forms and the admin for example. Doctrine is a very advanced ORM tool (and a big a complex one as well). ZF is sort of th

Re: to understand MEDIA_URL

2009-01-05 Thread Mark Jones
Are you closing the file after you write to it and before you try to send it? Why do you have to write it to a file to deliver it as a static file, why not just render it to a response directly? On Jan 5, 4:13 am, Alan wrote: > Hi List, > Because I couldn't find any idea better I am using "MEDI

  1   2   >