Any companies in UK interested in outsourcing partnership with a Romanian company?

2015-03-23 Thread Gabriel - Iulian Dumbrava
Hi all, I don't know if this is the perfect place to post this, but I couldn't think of a better one. I'm open to suggestions. I run my own software company in Romania and between 8th and 21st of April I'll be in London. If there is anyone interested in having a chat face to face please contac

Re: Data migration script populating db table - testing

2015-03-23 Thread Filipe Ximenes
One way to do it is to run all operations, don't call "save" and verify "manually" if objects are correct. I don't know about other methods, but if someone else does it would be great. On Sun, Mar 22, 2015 at 6:29 AM, Murthy Sandeep wrote: > Hi > > I have created an data migration script for pop

Misleading 404 exception during unit tests.

2015-03-23 Thread Benjamin Scherrey
Can someone explain the test condition on line 31 of https://github.com/django/django/blob/master/django/contrib/staticfiles/views.py - Just spent a few hours trying to get my unit tests to pass and couldn't figure out what was going on until I found this weirdness. I understand serve() isn't mean

Re: Misleading 404 exception during unit tests.

2015-03-23 Thread Benjamin Scherrey
I see now that the behaviour of serve() was changed for 1.7 and it now returns a silent misleading 404 result rather than the old ImproperlyConfigured exception which would have provided a clue as to the actual root cause. See: https://docs.djangoproject.com/en/1.7/ref/contrib/staticfiles/#django.

Why I don't access the {{ user }} variable in template?

2015-03-23 Thread Fellipe Henrique
Hello, I have this settings.py [1], and my CustomUser [2] When I try to use in my template: {{ user_first_name }} don't show anything... What I miss in these code? Regards, [1] - https://gist.github.com/fellipeh/adbfaf06361d68650f95 [2] - https://gist.github.com/fellipeh/a0cc18f26aa9868a061

Re: Misleading 404 exception during unit tests.

2015-03-23 Thread Tim Graham
Please see https://github.com/django/django/commit/4c6ffcf7 for the rationale for the change. I am open to ideas, but I'm concerned that including details about the reason for the 404 might cause information leakage in production which wouldn't be desirable. On Monday, March 23, 2015 at 10:06:2

Re: Why I don't access the {{ user }} variable in template?

2015-03-23 Thread aRkadeFR
Do you have 'django.contrib.auth.context_processors.auth' in your context template processor? {{ user_first_name }} won't work anyway cause the variable set by the context_processor auth is user. To access a key or an attribute of a variable, the syntax is: {{ user.first_name }} documentation on

Re: Why I don't access the {{ user }} variable in template?

2015-03-23 Thread Fellipe Henrique
Yes, I have django.contrib.auth.context_processors.auth in my Tamplate processor: here is my template processor: TEMPLATE_CONTEXT_PROCESSORS ('django.contrib.auth.context_processors.auth', 'django.core.context_processors.debug', 'django.core.context_processors.i18n', 'django.core.context_processor

Re: Misleading 404 exception during unit tests.

2015-03-23 Thread Benjamin Scherrey
Hey Tim, Appreciate the link. It looks like we're trying to have it go both ways here. If we don't want to allow it into production then make it explicit and break it - just as before. If we want to recommend that it not go into production but then let users actually do it, don't silently break

Re: templates tags works in scripts sections of the html?

2015-03-23 Thread Vijay Khemlani
JSON is literally the notation for objects and arrays in JavaScript, when you "print" it it outputs valid JavaScript code. On Mon, Mar 23, 2015 at 11:59 AM, dk wrote: > AHHH!!!... > that make scenes that the java script did work when I did it manually. > I haven't use json files before, so

Re: Why I don't access the {{ user }} variable in template?

2015-03-23 Thread Daniel Roseman
On Monday, 23 March 2015 14:16:00 UTC, Fellipe Henrique wrote: > > Hello, > > I have this settings.py [1], and my CustomUser [2] > > When I try to use in my template: > > {{ user_first_name }} > > don't show anything... What I miss in these code? > > You should show your view. Are you using a Re

Re: templates tags works in scripts sections of the html?

2015-03-23 Thread dk
AHHH!!!... that make scenes that the java script did work when I did it manually. I haven't use json files before, so I am not sure how to manage that, I will look around for more information on that. On Friday, March 20, 2015 at 4:59:30 PM UTC-5, dk wrote: > I am trying to create an au

Re: How to supply parameters to "python manage.py syncdb" from a script?

2015-03-23 Thread Dan Dong
Thanks Russell, that's clear now. Cheers, Dan 在 2015年3月20日星期五 UTC-5下午6:27:12,Russell Keith-Magee写道: > > > On Sat, Mar 21, 2015 at 5:25 AM, Dan Dong > > wrote: > >> Hi, >> Does anybody know how to supply the input parameters to "python >> manage.py syncdb" from a script? E.g, to set the the f

Re: Misleading 404 exception during unit tests.

2015-03-23 Thread Tim Graham
To have the decision revisited, you should raise it on django-developers. On Monday, March 23, 2015 at 10:39:57 AM UTC-4, Ben Scherrey wrote: > > Hey Tim, > >Appreciate the link. It looks like we're trying to have it go both ways > here. If we don't want to allow it into production then make

Re: Why I don't access the {{ user }} variable in template?

2015-03-23 Thread Fellipe Henrique
I found the problem, I was create a custom template context processor, and for some reason I choose one name that override some function in one os 3rd apps I'm using... I change the name of my custom context processor, and works Fine! Thanks again T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares*

Ho to "create" a field in a queryset to show in my template?

2015-03-23 Thread Fellipe Henrique
Hello, I have these view: def planos_view(request, cat_id=0): if cat_id == '0': categorias = Categoria.objects.filter(publicado=True) else: categorias = Categoria.objects.filter(publicado=True).filter(id=cat_id) for c in categorias: c.total = Plano.objects.fil

Re: Image in Form Field

2015-03-23 Thread Sandeep kaur
Anybody please help. On Sun, Mar 22, 2015 at 3:07 PM, Sandeep kaur wrote: > Greetings, > I want to have the thumnails of images with the names in the dropdown > field of form. To return the image as foreign key field, I have used this > code : > def __unicode__(self): > image_data = > o

Re: Ho to "create" a field in a queryset to show in my template?

2015-03-23 Thread Masklinn
Adding it as a regular property to your Categories class should work: # inside Categoria @property def total(self): return Plano.object.filter(categoria=self).count() You may also want to use backward relationship links to simplify the code and make it more robust, but I don't

Re: Image in Form Field

2015-03-23 Thread Vijay Khemlani
You can't include images in the options of a typycal html dropdown To do so you need to use JavaScript, for example this plugin http://designwithpc.com/plugins/ddslick#demo And pass the options in the format specified by the plugin On Mon, Mar 23, 2015 at 1:51 PM, Sandeep kaur wrote: > Anybod

Re: Ho to "create" a field in a queryset to show in my template?

2015-03-23 Thread Fellipe Henrique
Ok, But, if I want to create some "fields" in RunTime, I thinking to use Dict, but I don't know what to use to create "temporary" queryset... T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Blog: http://fhbash.wordpr

How to create a multi valued field in the model?

2015-03-23 Thread Daniel Grace
How to create a field with multiple values? For example an integer field that takes on particular values: state = models.IntegerField() ... where state=0 represents 'pending', state=1 represents 'accepted' and state=2 represents 'rejected'. Is it possible to put these values / constants into t

Re: How to create a multi valued field in the model?

2015-03-23 Thread Vijay Khemlani
You can use an IntegerField with choices https://docs.djangoproject.com/en/1.7/ref/models/fields/#choices On Mon, Mar 23, 2015 at 4:28 PM, Daniel Grace wrote: > How to create a field with multiple values? For example an integer field > that takes on particular values: > > state = models.Intege

Re: How to create a multi valued field in the model?

2015-03-23 Thread Filipe Ximenes
I'd also recommend using the "Choices" functionality of the Django Model Utils project. It will give you good tools to keep the code readable, simplify access and presentation of data: https://django-model-utils.readthedocs.org/en/latest/utilities.html#choices On Mon, Mar 23, 2015 at 4:34 PM, Vij

multiple parameters search

2015-03-23 Thread nobody
Hi, How can I search the database using multiple parameters similar like "where username ="myUserName" or email = "MyEmail"? I tried to run User.object.get(username = myusername or email = myEmail), but that caused syntax error. Thank you. Kind regards, - -j -- You received this message

Re: multiple parameters search

2015-03-23 Thread Vijay Khemlani
from django.db.models import Q User.object.get(Q(username=myusername) | Q(email=myEmail)) On Mon, Mar 23, 2015 at 9:30 PM, nobody wrote: > Hi, > > How can I search the database using multiple parameters similar like > "where username ="myUserName" or email = "MyEmail"? > > I tried to run User.o

ProgrammingError: relation "django_content_type" already exists

2015-03-23 Thread Mike Dewhirst
This is my first stab at upgrading directly from Django 1.6.11 to 1.81c to see what needs to be done. I thought I'd skip 1.7.x - is that a bad idea? Is there some step in 1.7.x which eases the path to 1.8.x? On first starting the project up using runserver on localhost it advises: Python: 3.