Re: App not found

2009-05-12 Thread Apple
about __unicoder__() you can find something usefull from Python doc or some books about python (core python programing ~~) good luck ! On Wed, May 13, 2009 at 10:32 AM, neri...@gmail.com wrote: > > Hello, > > I'm working on my first project and for some reason I keep getting > "Error: App with

Re: Design Question

2009-05-12 Thread Glen Jarvis
>> Both forms have a 'name' attribute. And, both forms are in a template >> together. (I mean that both form instances are created for the >> specific instance of the model in question, and are displayed >> together >> (very interleaved) in a template). The response that I get back, via >> reques

Re: What debugger do you use?

2009-05-12 Thread Gath
I use pyDev for eclipse, i think its the best debugger for Python/ Django. Gath On May 12, 10:52 pm, "ristretto.rb" wrote: > I second that!  WingIDE is aweome. > > I'm using NB with xdebug for PHP with one client, and WingIDE Pro > (which gladly paid for) > for python. > > I can say, for certai

Splitting monolithic

2009-05-12 Thread Jani Tiainen
Hi, I'm seeking for advices (or solutions) how to split my current monolithic application to more modular, smaller pieces. I've legacy database containing about 140 tables which are mapped to models. One key feature is "enum" table that has hundreds of enum-kind values (used mostly in value s

Re: Django static files

2009-05-12 Thread eculver
I figured this out. Your advice lead me in the right direction, but I went ahead and configured my urls.py like this: # For serving static media files (css, js, images) if settings.DEBUG: urlpatterns += patterns('', (r'^content/(.*)$', 'django.views.static.serve', {'document_root'

App not found

2009-05-12 Thread neri...@gmail.com
Hello, I'm working on my first project and for some reason I keep getting "Error: App with label orders could not be found. Are you sure your INSTALLED_APPS setting is correct?". I've verified this many times by creating dummy apps and running sqlall for them, which works for everything but an ap

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: Help a noob with a stupid question - forms

2009-05-12 Thread Margie
This is a great example for helping people (me) understand how to write their own widgets. I won't even pretend that I fully understand your code, but I'm getting there. Very useful, thanks so much for posting it. Margie On May 12, 8:17 am, George Song wrote: > On 5/12/2009 7:05 AM, zachp wr

Re: How to create a newforms label unattached to an input field?

2009-05-12 Thread Nash-t
Thanks for the help. I created the custom widget. It works OK but I cannot figure out how to get my custom class (for css) to render . Please check this out when you get a chance. class NakedLabelWidget(forms.Widget): """ A widget that produces a naked label """ def __init__(self, attrs=N

Re: session through redirects

2009-05-12 Thread Iqbal Abdullah
Hi George, Thank you for the response. I just realised that there was a bug in my code and now it works as expected. >From the link you gave, it also refreshed my mind and made me remember that sessions are saved in the db when request.session is changed, so it has no relation to the request obj

Re: mail add_flag

2009-05-12 Thread Karen Tracey
On Tue, May 12, 2009 at 4:11 PM, David wrote: > > Hello, > > I have read related part in python library and also searched this > list, however I still can not figure out where is wrong with my code. > so I post my question. > > I am using the following code to process e-mails in a user account. >

Re: Tutorial help, cannot save data

2009-05-12 Thread ajohnsen
Hello DR, Sorry I was misleading. I was actually referencing a section form the djangobook, chapter 7 -- not the tutorial. And I have read the link you you sent, but as in other places in the documentation, it seems the save command is only explained when in the shell. I can't figure out how t

Re: NoReverseMatch with Django-Profiles

2009-05-12 Thread Daniel Roseman
On May 12, 11:00 pm, Holger Latz wrote: > Hi, > > I included the Django-Profiles Module as recommended with > > (r'^profiles/', include('profiles.urls')), > > in my urls.py and so far it works fine. > > Now I'd like to make use of an the implemented kwarg 'success_url'. As > far as I use it wit

Re: Tutorial help, cannot save data

2009-05-12 Thread Daniel Roseman
On May 12, 10:14 pm, "asdjohn...@gmail.com" wrote: > Hello, > > I have just started with Django a few days ago and have gone through > the tutorial but can't figure out how to save user inputed data to the > database. > > For example, in chapter 7 we learn how to collect data and use it to > send

Tutorial help, cannot save data

2009-05-12 Thread asdjohn...@gmail.com
Hello, I have just started with Django a few days ago and have gone through the tutorial but can't figure out how to save user inputed data to the database. For example, in chapter 7 we learn how to collect data and use it to send an email: def contact(request): errors = [] if request.m

Comments redirect after posting is not honoured if comment contains errors or is previewed

2009-05-12 Thread Jeff Winters
Hello, In using the comments framework, I have experienced some odd behaviour with regard to the "next" redirection. Provided that one specifies a value for "next" as part of the context for the template that contains the comment form, users posting valid comments without previewing them will

NoReverseMatch with Django-Profiles

2009-05-12 Thread Holger Latz
Hi, I included the Django-Profiles Module as recommended with (r'^profiles/', include('profiles.urls')), in my urls.py and so far it works fine. Now I'd like to make use of an the implemented kwarg 'success_url'. As far as I use it within the urls.py it works: url(r'^create/$', views.create_

Re: Trouble starting up runserver

2009-05-12 Thread George Song
On 5/12/2009 2:01 PM, Chris DPS wrote: > I am new to Django. > > When I try to execute: python manage.py runserver, I get the following > error > > Error: [Errno 10104] getaddrinfo failed > > What is going on and what should I do? > > I am running Django Version 1.0.2-final and Python 2.6 > >

Trouble starting up runserver

2009-05-12 Thread Chris DPS
I am new to Django. When I try to execute: python manage.py runserver, I get the following error Error: [Errno 10104] getaddrinfo failed What is going on and what should I do? I am running Django Version 1.0.2-final and Python 2.6 I have turned off all Firewalls. ping to localhost in the cmd

two-step admin add_view

2009-05-12 Thread smcoll
i'm looking for advice on how to make the admin add_view better for the Registration model. The 'sessions' m2m and 'fee' fk should be filtered based on the 'event' fk (both Session and RegistrationFee have an 'event' fk as well). Of course, the filtering can't happen until the admin user chooses

Re: I/O operation on closed file

2009-05-12 Thread Alex Gaynor
On Tue, May 12, 2009 at 3:27 PM, Tim Sawyer wrote: > > Hi, > > I'm getting the following error uploading images to my gallery using the > admin > site, written in django (full stack at bottom of mail) > > ValueError: I/O operation on closed file > > It doesn't always happen, and it;s more likely t

I/O operation on closed file

2009-05-12 Thread Tim Sawyer
Hi, I'm getting the following error uploading images to my gallery using the admin site, written in django (full stack at bottom of mail) ValueError: I/O operation on closed file It doesn't always happen, and it;s more likely to occur using "Save but keep editing" in the admin. I'm using svn

Re: How do you handle apostrophe and spaces in dynamic url?

2009-05-12 Thread George Song
On 5/12/2009 1:10 PM, Thierry wrote: > 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

Re: How do you handle apostrophe and spaces in dynamic url?

2009-05-12 Thread Alex Gaynor
On Tue, May 12, 2009 at 3:10 PM, Thierry wrote: > > 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

mail add_flag

2009-05-12 Thread David
Hello, I have read related part in python library and also searched this list, however I still can not figure out where is wrong with my code. so I post my question. I am using the following code to process e-mails in a user account.

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

Re: Help a noob with a stupid question - forms

2009-05-12 Thread rskm1
On May 12, 6:47 am, zachp wrote: > ... I need the user who does this to be able to select a > month (and possibly a year) for the drawing she wants to run. I need > django to convert those two data points into a datetime object for me, > but it's not readily obvious how to do that. Are you SURE

Re: urgent, please help

2009-05-12 Thread Karen Tracey
On Tue, May 12, 2009 at 3:52 PM, hanan wrote: > > how can i define a method that would not perform any action ? in > java GUI > I think you are on the wrong list. Django is a Python web framework -- how that relates to defining a method that doesn't perform any action in a Java GUI is beyond

urgent, please help

2009-05-12 Thread hanan
how can i define a method that would not perform any action ? in java GUI thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups

Re: What debugger do you use?

2009-05-12 Thread ristretto.rb
I second that! WingIDE is aweome. I'm using NB with xdebug for PHP with one client, and WingIDE Pro (which gladly paid for) for python. I can say, for certain, that I would choose Wing over NB if I had to choose one. Gene Campbell On May 13, 1:54 am, James Matthews wrote: > I use WingIde an

Re: how can I modify automatic ordering of fields in a ModelForm?

2009-05-12 Thread Luke Graybill
Sorry, see my last reply above; dpaste.org doesn't seem to have an edit feature, so I submitted a new paste without typos. On Tue, May 12, 2009 at 1:37 PM, George Song wrote: > > On 5/12/2009 12:28 PM, Luke Graybill wrote: > > Here is how I've implemented field ordering for 1.0.2 > > The snippet

Re: how can I modify automatic ordering of fields in a ModelForm?

2009-05-12 Thread George Song
On 5/12/2009 12:28 PM, Luke Graybill wrote: > Here is how I've implemented field ordering for 1.0.2 The snippet doesn't appear to be available anymore. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users"

Re: how can I modify automatic ordering of fields in a ModelForm?

2009-05-12 Thread Luke Graybill
Erm, that should be this link, my apologies: http://dpaste.org/7WiU/ On Tue, May 12, 2009 at 1:28 PM, Luke Graybill wrote: > The fields option on the inner Meta class does not appear to function that > way in 1.0.2; I presume it is a 1.1 forward feature. (doh, yeah it says > development version

Re: how can I modify automatic ordering of fields in a ModelForm?

2009-05-12 Thread Luke Graybill
The fields option on the inner Meta class does not appear to function that way in 1.0.2; I presume it is a 1.1 forward feature. (doh, yeah it says development version only in those docs you pointed to) Here is how I've implemented field ordering for 1.0.2, and it seems pre

Re: Custom File Handling Through admin

2009-05-12 Thread rpupkin77
Thanks, I'll take a look, Brightcove is an enterprise video service based in Cambridge, MA, Quite impressive API if you have the money and don't want to use a traditional CDN. http://www.brightcove.com On May 12, 10:44 am, Karen Tracey wrote: > On Mon, May 11, 2009 at 5:45 PM, rpupkin77 wrote:

Re: how can I modify automatic ordering of fields in a ModelForm?

2009-05-12 Thread George Song
On 5/12/2009 12:12 PM, Alex Gaynor wrote: > You can control the order of fields on a modelform by settings the > ordering in the fields option in the inner Meta class. That is if you > set fields = ['b', 'a', 'c'] that's the same order they will apear in. Duh. There you go, problem solved:

Re: how can I modify automatic ordering of fields in a ModelForm?

2009-05-12 Thread Alex Gaynor
On Tue, May 12, 2009 at 2:04 PM, George Song wrote: > > On 5/12/2009 11:32 AM, Luke Graybill wrote: > > I didn't mean to imply a feature suggestion, I meant to ask if this is > > possible already. If not, then is there some way to manipulate the form > > __init__ (through _meta.fields perhaps?) t

Re: how can I modify automatic ordering of fields in a ModelForm?

2009-05-12 Thread George Song
On 5/12/2009 11:32 AM, Luke Graybill wrote: > I didn't mean to imply a feature suggestion, I meant to ask if this is > possible already. If not, then is there some way to manipulate the form > __init__ (through _meta.fields perhaps?) to accomplish an approximation > of what I want? > > I'm jus

Re: how can I modify automatic ordering of fields in a ModelForm?

2009-05-12 Thread Luke Graybill
I found some help here: http://code.djangoproject.com/wiki/CookBookNewFormsFieldOrdering, but have yet to attempt that suggestion (it is for newforms, so I'm unsure if it works with 1.0.2). Apparently also ticket #8164was implemented in 1.1 which allows th

Re: how can I modify automatic ordering of fields in a ModelForm?

2009-05-12 Thread Luke Graybill
I didn't mean to imply a feature suggestion, I meant to ask if this is possible already. If not, then is there some way to manipulate the form __init__ (through _meta.fields perhaps?) to accomplish an approximation of what I want? I'm just looking for a best-practice solution here - am I out of lu

Re: get_or_create not atomic?

2009-05-12 Thread Malcolm Tredinnick
On Tue, 2009-05-12 at 10:47 -0700, Phil Mocek wrote: > On Tue, May 12, 2009 at 02:25:41AM -0700, Daniel Roseman wrote: > > No, [get_or_create is] not atomic. By the way, that depends on what grained-ness of atomicity you're after, which hasn't been defined in this thread. The guarantee is that af

Re: how can I modify automatic ordering of fields in a ModelForm?

2009-05-12 Thread George Song
On 5/12/2009 11:22 AM, Luke Graybill wrote: > Is there a good way to dynamically reorder these fields on the fly? > Preferably, the code should be contained within the Mixin class. In > my situation, the mixin fields would be better if placed after all > the other fields on a model, but in othe

Re: flatpage content not appearing

2009-05-12 Thread George Song
On 5/12/2009 10:54 AM, Jesse wrote: > Now I get all kinds of 404 errors. I guess I'm missing something in > my understanding of flatpages. I was going to place all my html pages > into flatpages, including the home page. How does all that work > without using URLs and views? It's answered in t

how can I modify automatic ordering of fields in a ModelForm?

2009-05-12 Thread Luke Graybill
I am using a mixin class on some of my models that provides a few extra fields: > class Mixin(models.Model): > code = models.CharField(max_length=8, blank=True, unique=True) > hint = models.CharField(max_length=8, unique=True, null=True, > blank=True) > > class Meta: >

Re: get_or_create not atomic?

2009-05-12 Thread George Song
On 5/12/2009 10:47 AM, Phil Mocek wrote: > It seems risky to try to handle at the > application level these things that a DBMS is specifically > designed to do. Well, exactly. If the correct constraints are put in place, then your DB/adaptor would raise the proper error. So if a row is supposed

Re: flatpage content not appearing

2009-05-12 Thread Jesse
Now I get all kinds of 404 errors. I guess I'm missing something in my understanding of flatpages. I was going to place all my html pages into flatpages, including the home page. How does all that work without using URLs and views? On May 12, 10:42 am, Daniel Roseman wrote: > On May 12, 6:13 

Re: get_or_create not atomic?

2009-05-12 Thread Phil Mocek
On Tue, May 12, 2009 at 02:25:41AM -0700, Daniel Roseman wrote: > No, [get_or_create is] not atomic. You can see the code in > django.db.models.query - it tries a db lookup, and then creates > a new object if one is not found. It seems that this creates a potentially-troublesome race condition.

Re: flatpage content not appearing

2009-05-12 Thread Daniel Roseman
On May 12, 6:13 pm, Jesse wrote: > Hello, > > I'm using tiny_mce with flatpages in the admin.  I can get the > template to appear with the extended CSS, but not the flatpage > contents of the page. > My flatpage in admin is: > URL:  / > Content:  much text that is not appearing in the template. >

Re: Having trouble authenticating/validating

2009-05-12 Thread adrian
Figured it out by looking at how the admin view using AuthenticationForm: In POST: loginForm = AuthenticationForm(data=request.POST) note the use of data= which I have not seen before in GET: loginForm = AuthenticationForm(request) request.session.set_test_cookie() note the passing

Re: Mysterious problem with pydoc

2009-05-12 Thread Karen Tracey
On Mon, May 11, 2009 at 7:02 PM, aaronelliotross wrote: > > Ah ha! It's triggered by ForeignKey columns, creating a super simple > project ( no db data, no nothin' ) with this models.py shows the > problem. > This sounds like: http://code.djangoproject.com/ticket/8248 which was fixed a few mon

Re: Having trouble authenticating/validating

2009-05-12 Thread adrian
For the record, I am seeing the same problem. request.POST contains the correct values for username and password, yet is_valid returns false and the form does not include any error messages. I haven't gotten to the bottom of it yet but AuthenticationForm is not calling the clean() method. And I

flatpage content not appearing

2009-05-12 Thread Jesse
Hello, I'm using tiny_mce with flatpages in the admin. I can get the template to appear with the extended CSS, but not the flatpage contents of the page. My flatpage in admin is: URL: / Content: much text that is not appearing in the template. The template: ...templates/flatpages/default.html

Re: Strange widget and form problem

2009-05-12 Thread Karen Tracey
On Mon, May 11, 2009 at 8:25 AM, timc3 wrote: > > I have just updated to trunk and now I get a problem... OK, after looking at this a little more closely I'm not sure your shell session is accurately re-creating whatever problem your real code is encountering. I also see an error in your form

Re: Google website optimizer--A/B testing

2009-05-12 Thread Baxter
On May 12, 9:02 am, "bax...@gretschpages.com" wrote: > Does anyone know how one would do A/B testing a la Google Website > Optimizer with Django? Some sort of middleware, maybe? Disregard. After reading Google's docs a bit, all you have to do is create an alternate URL, really. Not a Django thin

Re: Help a noob with a stupid question - forms

2009-05-12 Thread George Song
On 5/12/2009 7:05 AM, zachp wrote: > Yes, but the calendar widget isn't what I want. My user only really > needs to pick a month (and maybe a year) but not a day. I could resort > to using that field type, but I wanted to see if I could overcome this > problem since, at least in my opinion, the ca

Re: What debugger do you use?

2009-05-12 Thread Stef Mientki
On Tue, May 12, 2009 at 11:28 AM, Daniel Roseman < roseman.dan...@googlemail.com> wrote: > > On May 11, 1:53 pm, Joshua Russo wrote: > > I'm currently using Netbeans 6.5 with the Python plugin. I was just > > wondering what everyone else is using because NB is a bit buggy with > > the Python plug

Re: session through redirects

2009-05-12 Thread George Song
On 5/12/2009 5:45 AM, Iqbal Abdullah wrote: > I'm confused on how to get data in request.session if a certain view > redirects the user using HttpResponseRedirect() > > A sample code: > > def view_start(request): > try: > Member(id) > except Exception, e: >

Re: modular django site: projects vs. apps

2009-05-12 Thread George Song
On 5/12/2009 3:27 AM, mabuse wrote: > I am developing a django site and my aim is to obtain a site with a > core application that would be the site basis and above it addons > that would upgrade the standard application ( like firefox and its > extensions). > > My question is, how can I achieve

Re: Custom File Handling Through admin

2009-05-12 Thread Karen Tracey
On Mon, May 11, 2009 at 5:45 PM, rpupkin77 wrote: > > Hi, > > I need to have a FileField from a model handled differently than the > out of the box functionality, In short I need to add it to the a > Brightcove account through their API, can someone give me a really > brief rundown of how I would

Re: how to catch the errors throwed by django when django project deployed under fastcgi

2009-05-12 Thread feng Tang
James: i just need the the tracelogs, just like developing in django development server, when error happen, it will print traceback pointing where the error happen. but now i deploy my project in nginx + fastcgi mode, which i get is the nginx 5x.html saying 'Unhandled Exception', and nginx's

Re: How do I handle urls with different names?

2009-05-12 Thread Thierry
I really like the idea of how to create those urls. Once I have extracted the name and type from the url, do I retrieve my Pet object like the following: current_pet = Pet.objects.get(name__iexact=name, type__iexact=type) If my table has 1000s of pets, isn't the above a bit slow when compared t

Re: How do I handle urls with different names?

2009-05-12 Thread Alex Gaynor
On Tue, May 12, 2009 at 9:27 AM, Thierry wrote: > > I really like the idea of how to create those urls. Once I have > extracted the name and type from the url, do I retrieve my Pet object > like the following: > > current_pet = Pet.objects.get(name__iexact=name, type__iexact=type) > > If my tabl

Re: Help a noob with a stupid question - forms

2009-05-12 Thread Sean Brant
Oh i see. Have a look at this widget from django.forms.extras.widgets import SelectDateWidget date = forms.DateField(widget=SelectDateWidget) This will display Month, Day, and Year as separate selects. I would probably subclass it to drop the Day field. Just automatically have it set in the bac

Re: how to catch the errors throwed by django when django project deployed under fastcgi

2009-05-12 Thread James Matthews
Can you please provide some more details? Where you are seeing the error. What is crashing,tracelogs etc.. Thanks James On Tue, May 12, 2009 at 3:38 PM, linvar wrote: > > hi everyone: >recently i deployed my django project under the nginx + django + > fastcgi mode, > > i upload my project t

Re: refill fields of a form in case of error

2009-05-12 Thread Daniel Roseman
On May 12, 2:00 pm, Miguel wrote: > in case of errors in the form,  in which objects are sent back the fields > which are already filled? > > Miguel > Sent from Madrid, Spain Your original post didn't make clear that you're not using the Django forms library. If you were - and really, I highly r

Re: Help a noob with a stupid question - forms

2009-05-12 Thread zachp
Yes, but the calendar widget isn't what I want. My user only really needs to pick a month (and maybe a year) but not a day. I could resort to using that field type, but I wanted to see if I could overcome this problem since, at least in my opinion, the calendar widget might be a little confusing.

Google website optimizer--A/B testing

2009-05-12 Thread bax...@gretschpages.com
Does anyone know how one would do A/B testing a la Google Website Optimizer with Django? Some sort of middleware, maybe? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, sen

Re: Help a noob with a stupid question - forms

2009-05-12 Thread Sean Brant
Did you try date = models.DateTimeField(). This will show up in the admin tool as a calendar widget that you can use to select the date. Django takes care of converting the dates into Python objects and into whatever format your database needs for storing. You could also just use a DateField if yo

Re: What debugger do you use?

2009-05-12 Thread James Matthews
I use WingIde and love it! On Mon, May 11, 2009 at 3:53 PM, Joshua Russo wrote: > > I'm currently using Netbeans 6.5 with the Python plugin. I was just > wondering what everyone else is using because NB is a bit buggy with > the Python plugin at the moment. > > > -- http://www.jewelerslounge.

Re: refill fields of a form in case of error

2009-05-12 Thread Miguel
in case of errors in the form, in which objects are sent back the fields which are already filled? Miguel Sent from Madrid, Spain On Tue, May 12, 2009 at 1:17 PM, Miguel wrote: > > > > if request.POST: > new_data = request.POST.copy() > datos = request.POST.copy() >

Help a noob with a stupid question - forms

2009-05-12 Thread zachp
Hi, I'm completely new to django, so please bear with me. My first project is a site which handles a monthly prize drawing for my company. People build up points throughout the month by carpooling/ biking to work, etc, and at the end of the month a drawing is done to determine a winner. My questio

Re: Populating Foreign key in modelform with exclude

2009-05-12 Thread Claude
I too had this issue until I found out I was going about it the wrong way. See Django docs - http://docs.djangoproject.com/en/dev/topics/forms/modelforms/#using-a-subset-of-fields-on-the-form Your code should be :- formContent = PropertyForm(request.POST) form_instance = formContent.save(commi

session through redirects

2009-05-12 Thread Iqbal Abdullah
Hi guys, I'm confused on how to get data in request.session if a certain view redirects the user using HttpResponseRedirect() A sample code: def view_start(request): try: Member(id) except Exception, e: # redirect to registration page if this id is not re

how to catch the errors throwed by django when django project deployed under fastcgi

2009-05-12 Thread linvar
hi everyone: recently i deployed my django project under the nginx + django + fastcgi mode, i upload my project to the sever and i encounter 'Unhandled Exception throwed by app', but in my development enviroment no error happen. now i want to catche the django exception just like developmen

Re: refill fields of a form in case of error

2009-05-12 Thread Miguel
if request.POST: new_data = request.POST.copy() datos = request.POST.copy() msg_error = comprobar_errores_evaluacion(new_data, bloques, formato_tiempo) if msg_error=="": [...] > this part is not execute becasuse we have errors in the form.

Re: exclude subquery executed twice?

2009-05-12 Thread Alex Gaynor
On Tue, May 12, 2009 at 1:53 AM, Malcolm Tredinnick < malc...@pointy-stick.com> wrote: > > On Sat, 2009-05-09 at 20:18 -0700, Henry Andrews wrote: > > Hi folks, > > When excluding using a subquery, I'm seeing the subquery being > > executed first as its own query, then seeing the correct query b

Re: refill fields of a form in case of error

2009-05-12 Thread Daniel Roseman
On May 12, 11:37 am, Miguel wrote: > Hi all, > > I have a dynamic form with lot of fields. The problem is that in case of > error, the failed field is indicated to the user but the user must rewrite > the rest of the fields. > I am sure it may be a way to post the not error fields back to the for

Re: upload_to usage

2009-05-12 Thread Alex Gaynor
On Tue, May 12, 2009 at 4:24 AM, Alex Rades wrote: > > Hi, > I'd like to save my images using this schema (which is, I think, > something 99% of web sites do): > > def upload_to(instance, filename): > return "photos/%s/%s"%(instance.pk % 1000, filename) > > the problem is that, as mentioned in

Re: two models, 1 table

2009-05-12 Thread Alex Gaynor
On Tue, May 12, 2009 at 2:43 AM, Malcolm Tredinnick < malc...@pointy-stick.com> wrote: > > On Mon, 2009-05-11 at 22:19 -0700, George Song wrote: > > On 5/11/2009 8:55 PM, rpupkin77 wrote: > > > Hi, can I use the same table in two different models and surface > > > different data in each, model, pa

Re: Django static files

2009-05-12 Thread Tim Chase
eculver wrote: > I know this one has been covered pretty well, and I'm not a "total" > newb to django, but something alludes me here. Why when I put: > > if settings.DEBUG: > urlpatterns += patterns('', >(r'^media/(?P.*)$', 'django.views.static.serve', > {'document_root': se

refill fields of a form in case of error

2009-05-12 Thread Miguel
Hi all, I have a dynamic form with lot of fields. The problem is that in case of error, the failed field is indicated to the user but the user must rewrite the rest of the fields. I am sure it may be a way to post the not error fields back to the form when this form is displayed again but I don't

modular django site: projects vs. apps

2009-05-12 Thread mabuse
I am developing a django site and my aim is to obtain a site with a core application that would be the site basis and above it addons that would upgrade the standard application ( like firefox and its extensions). My question is, how can I achieve that? My idea is to create two projects: 1. One

Auto populate ModelAdmin

2009-05-12 Thread Matias Surdi
I've noticed that on the admin interface, if a model has for example a "name" attribute, if I access to the add form with an url like this: http://localhost:8000/admin/mymodel/add?name=something The name field is prepopulated with the parameter value. Is this behaviour documented somewhere? I

Re: creating objects in views

2009-05-12 Thread Daniel Roseman
On May 12, 10:51 am, Oleg Oltar wrote: > Hi! > I am running small blog-styled information site. Which contains articles > added via admin application > Now I am trying to add possibility to add comments, so I defined a comment > Model (which contains Foreign Key to article object, and few text fi

creating objects in views

2009-05-12 Thread Oleg Oltar
Hi! I am running small blog-styled information site. Which contains articles added via admin application Now I am trying to add possibility to add comments, so I defined a comment Model (which contains Foreign Key to article object, and few text fields), also defined forms. Can you please explain

Re: Category list in Django

2009-05-12 Thread Bro
Big thanks to Matthias and everyone that help me a lot. To correct this error, I get the last Django and Django-mptt trunk. The error is gone :) On 11 mai, 14:19, Andy Mikhailenko wrote: > Hi, > > > in register dispatcher.connect(pre_save, > > signal=model_signals.pre_save, sender=modem) > > At

Re: What debugger do you use?

2009-05-12 Thread Daniel Roseman
On May 11, 1:53 pm, Joshua Russo wrote: > I'm currently using Netbeans 6.5 with the Python plugin. I was just > wondering what everyone else is using because NB is a bit buggy with > the Python plugin at the moment. I've never seen the need for anything better than plain old pdb. You can insert

Re: get_or_create not atomic?

2009-05-12 Thread Daniel Roseman
On May 12, 10:04 am, Will McGugan wrote: > Hi, > > I recently tracked down a strange bug in our site where 2 object existed but > the code was expecting only one. > > I think this is due to get_or_create, which doesn't appear to be atomic. > What I assume happened is that two requests came in clo

Re: tinyMCE installation

2009-05-12 Thread Joost Cassee
On May 12, 10:03 am, marchinux wrote: > NOW what other steps i have to do? my goal is to obtain in the ADMIN > interface a riche text fieldin the simplest way i have to > modufy my admin.py ? In the admin.py i have a class like this... > > class ArticleAdmin(admin.ModelAdmin): >     pass

get_or_create not atomic?

2009-05-12 Thread Will McGugan
Hi, I recently tracked down a strange bug in our site where 2 object existed but the code was expecting only one. I think this is due to get_or_create, which doesn't appear to be atomic. What I assume happened is that two requests came in close together and tested for the existence of the object

Re: Random locale strings translated

2009-05-12 Thread phred78
Hey Rob, I had "fuzzy" lines in all of the not translated strings. It's actually quite smart, isn't it? I had no idea. Thanks for your help, it's working perfectly now :-) Fred --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Googl

Re: Display an URLField as a Link

2009-05-12 Thread Reiner
Initially I thought you were talking about the admin, because of the column url you mentioned. If that's the case, have a look at this part of the documentation. You can define a property on your model, or if you just want the admin to display it as a link, use a module-level function or define it

tinyMCE installation

2009-05-12 Thread marchinux
Django version 1.0.2 Django-tinymce trunk version My GOAL is to install tinymce to add a rich-text editor with a filebrowser image updater. I tried the JS way...like described in "Pratical Django application" book. I downloaded TinyMCE distribution and added the javascript code to the admin temp

Question - sound files and Django.

2009-05-12 Thread Peter Murphy
All, I have a question for the list. I am thinking about making a small website for a friend - a singer/songwriter - that will allow him to embed soundfiles for download and/or streaming by others. I'd like to provide a nice "admin" interface for him so that he can upload his mp3s (or similar) w

Re: What debugger do you use?

2009-05-12 Thread Thomas Guettler
Hi, I use Emacs for editing and assert and logging for debugging. Joshua Russo schrieb: > I'm currently using Netbeans 6.5 with the Python plugin. I was just > wondering what everyone else is using because NB is a bit buggy with > the Python plugin at the moment. -- Thomas Guettler, http://ww

upload_to usage

2009-05-12 Thread Alex Rades
Hi, I'd like to save my images using this schema (which is, I think, something 99% of web sites do): def upload_to(instance, filename): return "photos/%s/%s"%(instance.pk % 1000, filename) the problem is that, as mentioned in the documentation about the "instance" parameter of upload_to: "In

Re: return jquery json variable to template variable

2009-05-12 Thread Dan Mallinger
So it's late and I may be missing the point, but it looks like you're mixing up the time of execution for some items... It seems like you're trying to set a template variable equal to the result of a json call and then subsequently use it for something. I can only think of two scenarios here: 1.