Re: Dumping objects in templates

2008-02-08 Thread Jorge Gajon
On Fri, Feb 8, 2008 at 6:46 AM, Gollum <[EMAIL PROTECTED]> wrote: > Is there any way to dump the whole object to html, for usual debugging > purposes. All I want is to see some objects whole structure, all field > values, child sets, etc. that are available for template. > I'm kind of new to p

Re: Passing form initial values from one view to another?

2008-01-24 Thread Jorge Gajon
Hi Dennis, On Jan 23, 2008 9:19 PM, Dennis <[EMAIL PROTECTED]> wrote: > follow up here though. Once this is implemented you end up with the > redirect URL looking something like this: > > http://mygreatwebsite.com/django_app/process/?newcontext=22 > > Which seems okay, but I also have a couple o

Re: Passing form initial values from one view to another?

2008-01-22 Thread Jorge Gajon
On Jan 20, 2008 11:58 PM, Dennis <[EMAIL PROTECTED]> wrote: > > This works from the standpoint of getting back to the "process.html" > template with the new Context object selected on the original form. > However, since this is using render_to_response instead of a redirect, > the URL on the user'

Re: ANN: Django-fr.org is out!

2007-06-25 Thread Jorge Gajon
On 6/22/07, Jeremy Dunck <[EMAIL PROTECTED]> wrote: > > Dice que estas en #django-es en freenode o un otra network? Estoy en > #django-es ahora. > > (Como se dice "network"?) > Se dice "red" Saludos! --~--~-~--~~~---~--~~ You received this message because you ar

Re: Interesting problem importing

2007-04-07 Thread Jorge Gajon
On 4/7/07, Michael Newman <[EMAIL PROTECTED]> wrote: > > In the manage.py shell an error when I do the export > File "", line 1 > export DJANGO_SETTINGS_MODULE = speakeasy.settings > ^(arrow is under the E) > SyntaxError: invalid syntax > Hi Michael, I probably was

Re: Import, referencing modules across packages

2007-04-06 Thread Jorge Gajon
On 4/6/07, Trey <[EMAIL PROTECTED]> wrote: > > Alright, I would like to reuse one of the forms, say Form1 inside of > the views for app2. So inside of the function I try this: > > def viewfunction(request): > from app1.forms import Form1 > > which fails pretty badly, I have also tried this: > > d

Re: Interesting problem importing

2007-04-06 Thread Jorge Gajon
On 4/6/07, Michael Newman <[EMAIL PROTECTED]> wrote: > > I am extremely new to programming, much less Django, but am working my > tail off trying to deploy a student alternative Webzine site. > > For the images I have been trying to use the nesh utils, > http://trac.studioquattro.biz/djangoutils/w

Re: Serving Media through mod_proxy.

2007-02-27 Thread Jorge Gajon
Hi David, On 2/27/07, David Abrahams <[EMAIL PROTECTED]> wrote: > > I'm running django with Apache/mod_python and serving media through > lighttpd. I have only one IP address, so lighttpd is running on port > 8081, but some of my clients are behind firewalls that block ports > other than 80. > >

Re: model referencing itself

2007-01-04 Thread Jorge Gajon
Hi Aljosa, On 1/4/07, Aljosa Mohorovic <[EMAIL PROTECTED]> wrote: i'm trying to create a model which referencing itself and for this code i get this error: "name 'Chapter' is not defined" how do i do this or something similar? code: >>> from django.db import models class Chapter(models.Mode

Re: problem with inclusion_tag

2007-01-04 Thread Jorge Gajon
On 1/4/07, stoKes <[EMAIL PROTECTED]> wrote: On Jan 4, 12:10 pm, "Jorge Gajon" <[EMAIL PROTECTED]> wrote: > Hi Adam, > > On 1/3/07, stoKes <[EMAIL PROTECTED]> wrote: > > > base.html > > {% showmenu %} > > {% for serv

Re: problem with inclusion_tag

2007-01-04 Thread Jorge Gajon
Hi Adam, On 1/3/07, stoKes <[EMAIL PROTECTED]> wrote: base.html {% showmenu %} {% for service in services %} {{ service.name }} {% endfor %} but receiving this error: Exception Type: TemplateSyntaxError Exception Value:Invalid block tag:

Re: Curious error

2007-01-02 Thread Jorge Gajon
On 1/1/07, Ramdas S <[EMAIL PROTECTED]> wrote: class billnumber(models.Model): date = models.DateTimeField(auto_now_add=True, primary_key = True) def __str__(self): return self.id You added the 'primary_key' attribute to your date field, therefore your model will not have an 'i

Re: Can't get my URLs right.

2006-12-27 Thread Jorge Gajon
On 12/27/06, Jason <[EMAIL PROTECTED]> wrote: So now that I add an about page, as www.foo.com/about what I get is a bunch of 404 errors because it's looking form my CSS and images in: /about/css/styles.css (should be /css/styles.css) and images references in the CSS in about/css/i/abc.png (shou

Re: Extrange behavior with get 'self' FK in admin view

2006-12-24 Thread Jorge Gajon
Hi, On 12/20/06, ElGranAzul <[EMAIL PROTECTED]> wrote: Hi, i've and extrange behavior with admin views with the following code: I copied your code to a test project, added the missing Country and Island objects and tried it but I could not reproduce your problem, everything works fine here.

Re: dynamic query key asignment

2006-12-23 Thread Jorge Gajon
Hi there k1000, On 12/21/06, k1000 <[EMAIL PROTECTED]> wrote: Is there any way to create dynamically key ( 'thiskey_exact' ) in query object. eg: Object.objects.filter(thiskey_exact = 'something') I'll paste here an example from one project I have here: Actividad.objects.filter(nombre_

Re: Request data in inclusion tag

2006-12-21 Thread Jorge Gajon
Hi Eugene, On 12/21/06, Eugene Pyvovarov <[EMAIL PROTECTED]> wrote: Look, I have a little problem. I need to put on the page shopping cart icon and quantity of elements in cart. I make custom inclusion tag. But now I have a problem - I can not access request object with session data(I store q

Re: Admin login problem

2006-12-13 Thread Jorge Gajon
On 12/12/06, Yatla <[EMAIL PROTECTED]> wrote: > > Newbie here - saw that the same question was asked earlier but not > answered, and the post was locked so I could not reply. > > I have a Django site in a subdirectory as follows (via fcgi) - (using > ver 0.96 pre via svn) > > http://mydomain.com/d

Re: Validation 3 steep complicate form

2006-12-04 Thread Jorge Gajon
Hi, On 12/3/06, GvaderTh <[EMAIL PROTECTED]> wrote: > > Hello All. I read django documentation about forms, had seek internet > and didn't found solution for situation like this: I have order form > divided to 3 steeps, after every step should be validation and if > validation is succesfull, user

Re: Setting checkbox to check as default value

2006-12-04 Thread Jorge Gajon
Hi Jeff, On 12/2/06, jeffhg58 <[EMAIL PROTECTED]> wrote: > I have a custom manipulator and I am trying to set the checkbox default > to checked. > > For example, my field name is: > > forms.CheckboxField(field_name="current"), Pass a 'checked_by_default' argument to the CheckboxField constructor

Re: Calling Methods from Admin

2006-12-02 Thread Jorge Gajon
On 12/2/06, Beau Hartshorne <[EMAIL PROTECTED]> wrote: > > What's the best way make a method call from Django's admin? I'd like > to set up a link or button that re-sends emails to users who've lost > them to the Internet or spam traps or whatever. > Well, I'm not sure what is the best way to do

Re: Help with Contact Form

2006-12-01 Thread Jorge Gajon
On 11/30/06, luxagraf <[EMAIL PROTECTED]> wrote: > > Hello all I have a quick question, I just whipped up a custom > manipulator for a contact form and, following the suggestion in the > django docs, I'm using a > > HttpResponseRedirect("/contact/thankyou/") > > to get rid of the post data, but wh

Re: Accessing request and session objects from templates

2006-11-06 Thread Jorge Gajon
Hi, On 11/3/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I am wondering if there is a way to access request data and session object > directly from Django templates, in the same way as {{ user }} for instance. > I must admit I'm a bit lost with template context processors and so on... You

Re: setting and using an object variable without using a field

2006-11-04 Thread Jorge Gajon
On 11/3/06, Rob Slotboom <[EMAIL PROTECTED]> wrote: > And. it's working. > Just one question: Is this the right way to do such things? > I don't see any problem with it, as long as the template doesn't care where "voted_by_remote_add" comes from or how it is constructed. --~--~-~--~-

Re: Error importing settings.py

2006-10-31 Thread Jorge Gajon
On 10/31/06, sansmojo <[EMAIL PROTECTED]> wrote: > > Hello all! My server admin has set up an apache/mod_python server for > me, but we keep getting the following error: > http://paste.e-scribe.com/2490/ > > Our apache config is here: http://paste.e-scribe.com/2491/ > You probably only need to c

Re: Custom manipulator

2006-10-30 Thread Jorge Gajon
On 10/28/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > 1) {{form.teacher}} doesn't render the actual teacher assigned to that > course but just the first in the list of teachers. > I'm guessing here since I don't have open any project to test it on, but I suspect that is because you are init

Re: Generating a choices set from data

2006-10-30 Thread Jorge Gajon
On 10/27/06, Russell Keith-Magee <[EMAIL PROTECTED]> wrote: > > On 10/26/06, Ice9 <[EMAIL PROTECTED]> wrote: > > > > Hi, I'm kinda new to django, and I ran into a problem > > I'm making a cutom form, and one of the field I want it to be > > SelectField. the problem is I dont want to hard code the

Re: template and special character problem

2006-09-18 Thread Jorge Gajon
On 9/18/06, Phil <[EMAIL PROTECTED]> wrote: > I tried what you suggested (replace my meta http-equiv by your version) > and it does no good )c: Sorry to hear that Phil, I don't know what else to suggest :( It is really weird that it works when you duplicate the content-type line though. --~--~-

Re: template and special character problem

2006-09-17 Thread Jorge Gajon
On 9/16/06, Phil <[EMAIL PROTECTED]> wrote: > In the base.html template I added in the section a {% block > extrahead %}{% endblock %}. > And in the index.html template I added {% block extrahead %} http-equiv="content-type" content="application/xhtml+xml; > charset=UTF-8" /> {% endblock %} It

Re: template and special character problem

2006-09-14 Thread Jorge Gajon
Hi, On 9/12/06, Phil <[EMAIL PROTECTED]> wrote: > When I render index.html, the special character from base.html are > rendered normaly but the ones from index.html are shown as '?'. Make sure that the editor you are using is writing your files to disk with the correct encoding. --~--~-

Re: foreignKey + manipulator...performance problem, SOLVED

2006-09-04 Thread Jorge Gajon
Hi, On 8/31/06, Gábor Farkas <[EMAIL PROTECTED]> wrote: > you need to use the raw_id_admin = True flag in the ForeignKey, > and all will be fine. Great!, Thank you Gábor :) I was having the same problem too. Cheers, Jorge --~--~-~--~~~---~--~~ You received this

Re: foreignKey + manipulator...performance problem

2006-09-02 Thread Jorge Gajon
On 9/2/06, Jorge Gajon <[EMAIL PROTECTED]> wrote: > I think this should be put on a ticket as an enhancement, the > manipulator should load the foreign data only (and just only) when you > actually put a {{ form.foreign_field }} in your template and the html > select tag needs t

Re: foreignKey + manipulator...performance problem

2006-09-02 Thread Jorge Gajon
Hi, On 8/30/06, gabor <[EMAIL PROTECTED]> wrote: > everything is ok, until you call > > Owner.AddManipulator()... this will take a long time. I got this same problem yesterday, however I'm short in time so I couldn't look deeper on what to do. I ended passing follow={'field':False} and t

Re: Having trouble with views

2006-08-11 Thread Jorge Gajon
Many people come to Django without having knowledge of Python before, and that's perfectly fine!, but you must be aware that it is DOUBLE hard, and you must double your efforts to learn Django and Python alongside. My recommendation (and Malcolm also said it) is that you first get to know Python

Re: Scandinavian characters in .po files and timezones

2006-07-31 Thread Jorge Gajon
Hi, Take notice that there is also a 'fileencoding' setting in vim. When you create a new file in vim, 'fileencoding' will not be set and so it will take the current value from 'encoding'. When you open an existing file, vim will try to determine its encoding and set 'fileencoding' accordingly.

Re: debugging xmlhttprequest POST's is a PAIN! Need help.

2006-07-14 Thread Jorge Gajon
Hi, On 7/14/06, Jeremy Dunck <[EMAIL PROTECTED]> wrote: > Run with the built-in server and put this in your view code: > > import pdb > pdb.set_trace() > +1 for using pdb. It will save you a lot of time debugging your code. And if you haven't used pdb, check out this tutorial: http://www.ferg.o

Re: Custom Manipulator problem

2006-07-14 Thread Jorge Gajon
Hi again, I rushed with my previous email. Why don't you use the generated manipulator from the model instead of writing your own? You only need to change this line: manipulator = EntryManipulator() with this line: manipulator = Entry.AddManipulator() that should work. Then there's no nee

Re: Custom Manipulator problem

2006-07-14 Thread Jorge Gajon
Hi, You need to implement the save() method in your custom manipulator. Cheers On 7/14/06, Robert <[EMAIL PROTECTED]> wrote: > > Hello, > > When using custom Manipulator (which in fact does nothing.. I've cut > some additional custom validation here) I'm getting error as follows: >

Re: Non iterable argument

2006-07-13 Thread Jorge Gajon
Hi, You are calling manipulator.do_html2python() before the call to get_validation_errors() The correct thing is to call do_html2python() after you have validated the data and there are no errors. It should look like this: errors = manipulator.get_validation_errors(new_data) pri

Re: Please fix my ugly code

2006-07-13 Thread Jorge Gajon
l() if model: results = results.filter(model=model) if gorivo: results = results.filter(gorivo=gorivo) I'm sorry if I caused any confusion and for not paying more attention to that filtering part :) Cheers, Jorge On 7/13/06, Jorge Gajon <[EMAIL PROTECTED]>

Re: Please fix my ugly code

2006-07-13 Thread Jorge Gajon
Hi Carlos, I think your code is going good so far. Of course I'm not a guru but I think your code is fine. Is there something that you don't feel comfortable with? With respect to adding the results of both filters, you need to extend the results of the first results (if any), like this: res

Re: Checking whether a Foreignkey object has been assigned to anything

2006-07-12 Thread Jorge Gajon
Also, I think you need to add null=True to the ForeignKey, like this: category = models.ForeignKey(Category,null=True, blank=True) blank=True indicates the admin interface that a value can be omitted, but null=True is necessary to indicate to the database that the column can be NULL. On 7/

Re: Checking whether a Foreignkey object has been assigned to anything

2006-07-12 Thread Jorge Gajon
Hi, If there are not a lot of categories (i.e. a thousand or more), you could iterate over all categories and filter only those that have a photo_set of 1 or more. For example in a view you could do: categories = [c for c in Category.objects.all() if c.photo_set.count()] You could say that

Re: Having trouble with views

2006-07-12 Thread Jorge Gajon
Hi again, > a ForeignKey to Category in your Project model, i.e. that a Project > belongs to a Category, like this: Ooopss, I left something out there. But any case I wanted to apologize for rushing with my previous email, I did not read the email that Malcolm sent before and he is raising very

Re: Having trouble with views

2006-07-12 Thread Jorge Gajon
Hi Tomas, I have not read the previous emails, so please excuse me if I'm misinterpreting something. I'll comment on what you said on the last email only. > I have tried with but > I think I need to write a new function inside views.py in my > "portfolio" app, that will bring out that category s

Re: FileBrowser Test Version

2006-07-08 Thread Jorge Gajon
Wow, thank you this is fantastic. It's highly probable that I'll use this soon. When I do, I'll make sure to give you feedback and contribute back with something of course. Thank you for releasing this, it will be very useful for a project we will work on soon. Cheers, Jorge On 7/8/06, patri

Re: Where to put custom sql?

2006-07-06 Thread Jorge Gajon
Hi, I'm not sure if this could help you, or maybe I'm not getting it right. In any case please excuse me if this is something that you already have checked out. You can override the default managers to do different things. I think this could be useful: http://www.djangoproject.com/documentation/

Re: prepare method in Manipulator (and FomField) doesn't get called (and also a minor bug in CheckboxSelectMultipleField)

2006-07-06 Thread Jorge Gajon
> > Thanks. I don't know what to put inside html2python. The prepare > method actually sets the list to the values (the first value in the > tuple for choices). I don't think there's anything to change in html2python. As you said the prepare only puts the selected check boxes in the self.data lis

Re: prepare method in Manipulator (and FomField) doesn't get called (and also a minor bug in CheckboxSelectMultipleField)

2006-07-06 Thread Jorge Gajon
Hi Le Roux, > the field name is category_ids, but the checkboxes are named > category_ids1 and category_ids3. That is to be expected. Imagine you have two CheckboxSelectMultipleFields in your manipulator, one named 'color_selection' and other named 'music_selection', which represent foreign keys

Re: Try to tweak given manipulators or start from scratch?

2006-07-04 Thread Jorge Gajon
Hi Todd, > > and for a ForeignKey: > > related_object = OtherObject.objects.get(pk=23) > > new_data['related_object'] = str(related_object.id) > > This, not so much. The related object entry is in the data field of > the FormWrapper when I look at it, but if I render the SelectField it >

Re: Try to tweak given manipulators or start from scratch?

2006-07-03 Thread Jorge Gajon
Hi, The choice between doing a custom manipulator from scratch or using the automatically generated one depends on many factors. In an application that I am writing I used a custom manipulator because I needed to create several different objects (from different models) in one single step. So inst

Re: Limiting Choices in AddManipulator

2006-07-02 Thread Jorge Gajon
Hi, Maybe you could try this: user_choices = [(u.id, u) for u in User.objects.filter(query)] form['field_name'].formfield.choices = user_choices choices expects a list of tuples in the form of (value, display), so that it generates a select field like this: display1 display2

Re: custom form view not keeping information

2006-06-20 Thread Jorge Gajon
Hi, Why don't you post some code to see if we can understand better your problem and what modifications could be done? On 6/19/06, hotani <[EMAIL PROTECTED]> wrote: > > I'm pretty much giving up on this -- unless i find an alternative, I'm > going to end up using hidden fields with the generic

Re: The only click to add any class

2006-06-15 Thread Jorge Gajon
> And when I save form, got this error: > Invalid value: 'region' should be a 'serp2.apps.common.models.Region'> instance, not a Request The hint is in the error message. You must pass a Region object to the region parameter, new_data['region'] contains only the id that the user selected from t

Re: Initial data for sites framework?

2006-06-04 Thread Jorge Gajon
Hi, This is not exactly what you are asking for, but you can modify your own local copy of Django. The file to modify is: trunk/django/contrib/sites/management.py Change the line that looks like this: s = Site(domain="example.com", name="example.com") Cheers, Jorge On 6/4/06, [EMAIL PROTE

Re: Ajax support, there is no need for reinventing the wheel

2006-06-03 Thread Jorge Gajon
Jeff Forcier <[EMAIL PROTECTED]> wrote: > > As for the general AJAX discussion, I agree wholeheartedly with > James--there's no need to tightly couple a given framework, especially > since good AJAX is exactly what he suggested and what I, at least, have > used successfully--the JS framework on on

Re: How to validate CheckboxField?

2006-05-27 Thread Jorge Gajon
Hi, Yeah it's strange that the CheckboxField doesn't have a validator list. I guess this is worth a ticket. But there's a way to get what you want without passing a validator list. If you define a method "validate_field_name", that method will be called when you call the get_validation_errors() o

Re: Foreign keys in views

2006-05-26 Thread Jorge Gajon
Hi, I also found that behavior and what I did was to copy new_data['station'] to new_data['station_id'] when there were errors from "get_validation_errors()". Like this: def change_recording(request, recording_id): snip. if request.POST: new_data = request.POST.copy()

Re: Forms: SelectField with default value

2006-05-10 Thread Jorge Gajon
I'm not sure if you can specify a default to use with the built-in Admin views. However, if you are developing your own views you can set the default data to pass to the FormWrapper with something like this (I'm using this code and it works): def mycustomview(request): manipulator = MyModel.

Re: No Subclassing in models yet? How would you guys do the following:

2006-05-10 Thread Jorge Gajon
He is using a common joke found in the slashdot community. See http://en.wikipedia.org/wiki/Slashdot_culture But then again, this is not slashdot. So yeah, maybe he was drunk. On 5/10/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Hmm - were you drunk when you posted this? > > > > > --~-

Re: Question

2006-05-08 Thread Jorge Gajon
> In my urls.py I use > (r'^shop/(?P.*?)/','shopproject.apps.shop.views.shop.Index') > but also > (r'^TradeOffice/','shopproject.apps.shop.views.shop.TradeOffice'), > > so that I can not change simply > (r'^shop/(?P.*?)/','shopproject.apps.shop.views.shop.Index') > into > (r'^(?P.*?)/','shopproj