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: 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 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: 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: 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: 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: 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: 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: 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 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: 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: 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: 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 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: 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 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: 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: 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: 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: 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: 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: 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

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: 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 %}

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

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: 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

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: 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 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

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: 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

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: 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

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: 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: > 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: 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,

<    1   2