POST sub dictionaries

2009-01-19 Thread Vinicius Mendes
Is there in django something like the PHP POST subarrays? For example, if i do this in my form: and submit it, i will have the following data structure in my PHP POST: $_POST = array( 'test' => array( 0 => 0, 1 => 1 ) ) In django, i think it can turn into:

Trac + Sphinx

2009-03-31 Thread Vinicius Mendes
Hi all, Does anyone here integrate trac and sphinx? How do you take advantages from this? Vinícius Mendes Engenheiro de Computação Meio Código - A peça que faltava para o seu código! URL http://www.meiocodigo.com --~--~-~--~~~---~--~~ You received this

Re: Testing if a receiver is connected to a signal

2011-05-05 Thread Vinicius Mendes
Boa. Funciona para resolver esse problema. Atenciosamente, Vinicius Mendes Engenheiro de Computação Globo.com On Thu, May 5, 2011 at 1:33 PM, Bernardo Fontes <bernardo...@gmail.com>wrote: > Hello everybody, > > I resolved this problem by looking at Djangos Signal's code and

Re: Installing django

2010-04-15 Thread Vinicius Mendes
Follow the tutorial on http://docs.djangoproject.com http://docs.djangoproject.com/en/1.1/intro/tutorial01/#intro-tutorial01 __ Vinícius Mendes Solucione Sistemas http://solucione.info/ On Thu, Apr 15, 2010 at 10:23 AM, Jagdeep Singh Malhi < singh.malh...@gmail.com> wrote:

Re: Four Hop, Two Criteria Query

2010-05-27 Thread Vinicius Mendes
Just be careful with the index errors. If you are sure that this query will allway have at least one item, so this is fine. But if it returns an empty queryset, so you will have trouble with IndexError. Atenciosamente, Vinicius Mendes Solucione Sistemas vinic...@solucione.info On Thu, May 27

Re: Django 1.2.1 doesn't work with South but 1.2 works? How to find the previous version Django 1.2?

2010-06-01 Thread Vinicius Mendes
/ Atenciosamente, Vinicius Mendes Solucione Sistemas vinic...@solucione.info On Tue, Jun 1, 2010 at 10:29 PM, flyinglegs <flyingl...@gmail.com> wrote: > I am having some trouble with South database migration using Fabric. I > tried several machines, one works and the other 3 doesn't work

Re: hello django users, I have one doubt. I am doing one django project. It shows one SyntaxError in the line(if not created:) in views.py file.I attached the particular in that. I want the reason o

2010-06-04 Thread Vinicius Mendes
I guess it is because the 'I' is uppercase. Try all the line in lowercase. Atenciosamente, Vinicius Mendes Solucione Sistemas vinic...@solucione.info On Fri, Jun 4, 2010 at 8:54 AM, kanniga sivasubramanian < kskanniga...@gmail.com> wrote: > def bookmark_save_page(request): > if re

Re: Admin with only inlines, no fields

2010-06-29 Thread Vinicius Mendes
Try to debug this using PDB. You can insert some breakpoints where the form is not validated and see what are the errors. Atenciosamente, Vinicius Mendes Solucione Sistemas vinic...@solucione.info On Tue, Jun 29, 2010 at 12:14 PM, felix <crucialfe...@gmail.com> wrote: > > I nee

Re: Saving File/Image in tmp. I'm in trouble ...

2010-07-13 Thread Vinicius Mendes
I never used Django with S3 but the upload_to is a folder inside the folder referenced by the MEDIA_ROOT setting. Atenciosamente, Vinicius Mendes Solucione Sistemas vinic...@solucione.info On Tue, Jul 13, 2010 at 8:06 AM, The Danny Bos <danny...@gmail.com> wrote: > I can't g

Negate querysets

2010-03-22 Thread Vinicius Mendes
Is there any way to negate a queryset? Let's supose i have this queryset: User.objects.filter(first_name='vinicius') and I want to have the queryset with the objects that is not in first queryset. I know I can do this: User.objects.exclude(first_name='vinicius') But we have cases where we

Re: Making email unique

2010-03-28 Thread Vinicius Mendes
email = models.EmailField(unique=True) If it's using django.contrib.auth you can use something like this in the init of your project: from django.contrib.auth.models import User User._meta.get_field('email').unique = True __ Vinícius Mendes Solucione Sistemas

Re: Why must {% extends '' %} be first value in template? Inconvenient for ajax versions.

2010-03-28 Thread Vinicius Mendes
I implemented two solutions for this problem. The first one is the solution already said here: create a template context processor that inserts a variable in context with the name of the base template ("base.html" for normal requests and "base_ajax.html" for ajax requests). The second one is a

Re: tag generates another tags

2010-03-29 Thread Vinicius Mendes
You can include a template with area 1 and inside this template, you add the other tags. __ Vinícius Mendes Solucione Sistemas http://solucione.info/ On Sun, Mar 28, 2010 at 6:26 PM, Sławek Tuleja wrote: > Hi all! > my question is: can 'tag'

Re: content type printed as first line in mails

2010-03-29 Thread Vinicius Mendes
Django algo has a shortcut called django.template.loader.render_to_string. __ Vinícius Mendes Solucione Sistemas http://solucione.info/ On Mon, Mar 29, 2010 at 8:15 AM, bruno desthuilliers < bruno.desthuilli...@gmail.com> wrote: > On 29 mar, 10:47, "het.oosten"

Re: modelform validation

2010-03-31 Thread Vinicius Mendes
Test if self.instance.user is not None, if so, change the queryset to exclude the self.instance.user: http://gist.github.com/350440 __ Vinícius Mendes Solucione Sistemas http://solucione.info/ On Wed, Mar 31, 2010 at 11:24 AM, Emanuel wrote: > Hi

Re: Getting strange email from "dreamhost"

2010-03-31 Thread Vinicius Mendes
I getting those too. __ Vinícius Mendes Solucione Sistemas http://solucione.info/ On Wed, Mar 31, 2010 at 12:14 PM, Brandon Taylor wrote: > I'm getting those from this forum as well. > > On Mar 31, 10:13 am, Wiiboy wrote: > >

Re: Select previous and next from a table

2010-03-31 Thread Vinicius Mendes
I know how to do this with 3 queries: object = Model.objects.filter(pk=pk) previous = Model.objects.filter(votes__lt=object.votes).order_by('-votes')[:1][0] next = Model.objects.filter(votes__gt=object.votes).order_by('votes')[:1][0] My only problem with this is if there is any object with the

Re: URL data in templatetags

2010-04-05 Thread Vinicius Mendes
You can try this: context['request'].GET It will work only if you are using RequestContext[1] or add the request to the template manually. It can be achieved either using generic views [2] or passing the context_instance parameter to the render_to_response [3]. I usually prefer to use

Re: Dashboard plugin/widget development - create new post

2010-04-05 Thread Vinicius Mendes
This list is about Django, not PHP. __ Vinícius Mendes Solucione Sistemas http://solucione.info/ On Mon, Apr 5, 2010 at 1:23 PM, Jim N wrote: > Hi List, > > I thought this would be easy at first. Maybe it is. > > I am developing a dashboard widget

Re: How to concatenate a list of Q objects?

2010-04-06 Thread Vinicius Mendes
I recommend you to read more documentation about python. It's a basic python feature. You can read more about it here: http://www.saltycrane.com/blog/2008/01/how-to-use-args-and-kwargs-in-python/ Try this: Sample.objects.filter(*qObjects) __ Vinícius Mendes Solucione

Problem with admin actions and i18n

2010-04-06 Thread Vinicius Mendes
Hi, I have a ModelAdmin with two new actions and I added a locale/pt_BR/LC_MESSAGES to my project folder to change the translation of the "Delete selected" option. Locally it works but the translated message user is the provided by Django. I get my change list with 3 actions, but when I run it in

Re: Problem with admin actions and i18n

2010-04-06 Thread Vinicius Mendes
Sorry, i am using Django 1.1.1 final >>> import django >>> django.VERSION (1, 1, 1, 'final', 0) __ Vinícius Mendes Solucione Sistemas http://solucione.info/ On Tue, Apr 6, 2010 at 1:09 PM, Ramiro Morales <cra...@gmail.com> wrote: > On Tue, Apr 6,

Re: queryset in clean method

2010-04-06 Thread Vinicius Mendes
You can pass the competition instance to the for in the initialization. In the form you change the form a little bit adding the init method to receive the competition parameter. Then you can save it in a form attribute and then use it in clean method. I made a simple gist to show you haw it could

Re: How to concatenate a list of Q objects?

2010-04-07 Thread Vinicius Mendes
On Wed, Apr 7, 2010 at 2:00 PM, Tom Evans wrote: > On Wed, Apr 7, 2010 at 5:39 PM, Daniel wrote: > > Hi, > > > > Thank you for your help everyone. I know that I need to learn python > > better, and I did read those articles. What is still a bit

Re: How to concatenate a list of Q objects?

2010-04-07 Thread Vinicius Mendes
t, I'm having a little trouble > digesting just this one line: > > q = q | f if q else f > > That line of code only allows (q1 | q2 | q3), right? > > It will not allow mixing "AND" as well as "OR" (i.e., q1 & q2 | q3)? > > Thanks! > > > > On A

Testing if a receiver is connected to a signal

2011-02-21 Thread Vinicius Mendes
way. Any ideas? Atenciosamente, Vinicius Mendes Engenheiro de Computação Globo.com -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group,

DjangoCon US 2011

2011-03-31 Thread Vinicius Mendes
? Atenciosamente, Vinicius Mendes Engenheiro de Computação Globo.com -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to dj

Re: DjangoCon US 2011

2011-03-31 Thread Vinicius Mendes
or not. Atenciosamente, Vinicius Mendes Engenheiro de Computação Globo.com On Thu, Mar 31, 2011 at 8:49 PM, Steve Holden <holden...@gmail.com> wrote: > I have already started nagging people about this. It's only just over five > months to go, and it's definitely time the CfP went out. Expect to se

Re: DjangoCon US 2011

2011-04-01 Thread Vinicius Mendes
Thanks for the information. Atenciosamente, Vinicius Mendes Engenheiro de Computação Globo.com On Fri, Apr 1, 2011 at 1:48 AM, Shawn Milochik <sh...@milochik.com> wrote: > The event will definitely take place in Portland, Oregon in September. > > On Apr 1, 2011 12:15 AM, &

Re: Model design

2009-10-24 Thread Vinicius Mendes | meiocodigo.com
On Oct 24, 7:14 am, Caisys wrote: > Thanks !!! I also felt the second sounds more "right" which leads to > two requirements, the first is for convenience but the second is a > must: > > 1) On the admin page for add Place I will put 2 or 3 slots for adding > Subplace to a

Re: Model design

2009-10-25 Thread Vinicius Mendes | meiocodigo.com
e to create a view to retrieve the subplaces based in the selected > > place. > > I am not so sure how to do that yet. However, i would like to know how > i could not return the related object name in __unicode__ . Where did > I go wrong? > > Thanks > > On Oct 24, 1:38 pm

Re: Model design

2009-10-26 Thread Vinicius Mendes | meiocodigo.com
ng since places and > subplaces are not changed frequently so i can live with it for the > time being and move to more important parts until I am more familiar > with the forms. > > I just need to know how to call the a related field in __unicode__ > (self) > > On Oct 25, 2:3

Re: Negate querysets

2010-03-23 Thread Vinicius Mendes | meiocodigo.com
Ok. The code proposed by Tim Shaffer works and gives only one query. But it makes use of subselects, what is heavy for the database. Take a look at the generated SQL: 'SELECT `auth_user`.`id`, `auth_user`.`username`, `auth_user`.`first_name`, `auth_user`.`last_name`, `auth_user`.`email`,

Re: Negate querysets

2010-03-23 Thread Vinicius Mendes | meiocodigo.com
gt; - Paulo > > On Tue, Mar 23, 2010 at 1:23 PM, Vinicius Mendes | meiocodigo.com < > > > > vbmen...@gmail.com> wrote: > > Ok. The code proposed by Tim Shaffer works and gives only one query. > > But it makes use of subselects, what is heavy for the database. Take

Re: Negate querysets

2010-03-24 Thread Vinicius Mendes | meiocodigo.com
Ok. I thought it was more simple. I don't know the ORM in deep and forgot about the extra() method. Thanks for the explanation. On Mar 23, 5:15 pm, James Bennett <ubernost...@gmail.com> wrote: > On Tue, Mar 23, 2010 at 10:21 AM, Vinicius Mendes | meiocodigo.com > > <vbmen..