lazy error

2014-06-20 Thread hinnack
class test(models.Model): version = models.CharField(max_length=255, choices=lazy(getGibthubTags, list)()) and a function getGibthubTags returning en amply array or an array of sets... Using: manage.py runserver I sometimes get: raise TypeError("Lazy object returned unexpected typ

Re: Stack Overflow Open Source Advertising, 2H 2014

2014-06-20 Thread Jorge Cardoso Leitão
Hi Russell, Thanks for the input. My intention with my original mail wasn't to wave you off contributing; it > was to make sure that you are aware that if you're representing the > project, you need to use our trademarks correctly. If you don't, you weaken > our claim on the *actual* trademarks.

Re: Django Dying upon loop

2014-06-20 Thread Tom Evans
On Fri, Jun 20, 2014 at 12:16 AM, G Z wrote: > my django server dies whenever i login and access the following function: > > what is a better way to do what im doing. I need to loop through all of the > vm_groups by customer id, and then loop through all of the vms and associate > them with each o

Re: Language code issue - Django thinks default is en-us?

2014-06-20 Thread Vernon D. Cole
(*cough*) Excuse me, everyone, but many of the locale names mentioned in this discussion have been invalid. https://docs.djangoproject.com/en/1.6/topics/i18n/#term-locale-name says: > locale nameA locale name, either a language specification of the form ll > or a combined language and country s

Using forms/template to enter recurring events - how to avoid duplicate and redundant forms?

2014-06-20 Thread Stodge
I'm trying to make a template and form to let a user define a recurring event. I want to present different fields depending on whether they want daily, weekly, monthly or yearly recurrence. I'm not sure how to define the forms to do this so that the submitted data isn't duplicated or redundant.

Re: Language code issue - Django thinks default is en-us?

2014-06-20 Thread Stodge
This always confuses me - the language code is always lower case according to the docs. Which is specified in the settings - language codes or locales? I've always assumed the former. locale nameA locale name, either a language specification of the form ll or a combined language and country spe

Re: Language code issue - Django thinks default is en-us?

2014-06-20 Thread Tom Evans
On Fri, Jun 20, 2014 at 1:47 PM, Vernon D. Cole wrote: > (*cough*) > Excuse me, everyone, but many of the locale names mentioned in this > discussion have been invalid. > > https://docs.djangoproject.com/en/1.6/topics/i18n/#term-locale-name says: >> >> locale nameA locale name, either a language s

Django Rest Framework create api-root ???

2014-06-20 Thread Carlos Perche
Using DjangoRestFramework, how can I create api-root with all urls for my apps Like this e.g. I have following apps core_api views models serializers urls equipments views models serializers urls companies views models serializers urls contacts views models seriali

Re: Django Dying upon loop

2014-06-20 Thread G Z
Sad part is I can do it in python well, I just can't seem to grasp the way django works i keep reading the damn documentation but I cant see any good examples relating to what I have to do. On Friday, June 20, 2014 5:10:10 AM UTC-6, Tom Evans wrote: > > On Fri, Jun 20, 2014 at 12:16 AM, G Z > >

Upgrade Mysql

2014-06-20 Thread Dariusz Mysior
I use pythonanywhere.com Django 1.6 and Python 2.7 I and when I write p.save() I had error like below. It says something about updating mysql to fix it, but I don't know what code or shell commands I need to write. Can you help me? One person post that he upgrade MySQL to 5.0.27 but I don't

Re: Upgrade Mysql

2014-06-20 Thread François Schiettecatte
Dariusz Not sure about upgrading mysql, what the error is telling you is that mysql is dropping the connection before django is done with it. I would look at CONN_MAX_AGE in DATABASES (in settings.py) and wait_timeout in my.cnf, the first should be lower than the second. For example I have th

Re: Django Dying upon loop

2014-06-20 Thread G Z
There instead of looping through the queries i do it all in one loop but its still taking forever, how does django do the query, it seems like its doing a Cartesian product ? My server dies when ever I hit this page. query_results = Customer.objects.all() customers = {} data = {} cus

Re: Upgrade Mysql

2014-06-20 Thread Dariusz Mysior
But in mysite-mysite-settings.py in DATABASES I dont't have CONN_MAX_AGE and in don't have in my general directory file my.cnf :/ W dniu piątek, 20 czerwca 2014 17:31:10 UTC+2 użytkownik Dariusz Mysior napisał: > > I use pythonanywhere.com Django 1.6 and Python 2.7 I > > and when I write p

Re: Django Dying upon loop

2014-06-20 Thread G Z
shouldn't this work? After doing some more research into making django queries faster and more efficient I came across, http://tech.yipit.com/2013/01/20/making-django-orm-queries-faster/ I'm using thier method from what I understand you can selec_related to a primary key field and query like suc

Re: Django Dying upon loop

2014-06-20 Thread George Silva
You can use the raw() function to create a adhoc query to the database. Check the documentation and write proper sql code. It will be much more efficient. On Fri, Jun 20, 2014 at 12:44 PM, G Z wrote: > There instead of looping through the queries i do it all in one loop but > its still taking f

Recurring question. Automate manage.py syncdb

2014-06-20 Thread Rubén Ortiz
Hi I have to automate a kind of django setup in linux ubuntu box. The project runs under virtualenv. Then my main problem is when I have to execute the famous: $ python $VIRTUAL_ENV/opt/graphite/webapp/graphite/manage.py syncdb --pythonpath=$VIRTUAL_ENV/opt/graphite/webapp -v 2 I am very

Re: Recurring question. Automate manage.py syncdb

2014-06-20 Thread Ariel Calzada
I hope this helps you http://pastebin.com/umGv3br9 Greetings from Colombia ARIEL 2014-06-20 11:31 GMT-05:00 Rubén Ortiz : > Hi > > I have to automate a kind of django setup in linux ubuntu box. The project > runs under virtualenv. Then my main problem is when I have to execute the > famous: >

Django Post Issue

2014-06-20 Thread G Z
I'm trying to post customer_id while generating a combo box with a loop from a database query. I have the combo box generating and such, but the posted data does not return the customer id. It returns something weird. > {% csrf_token %} > > {% for item in customer %} > {{ > item.customer_name

Re: Upgrade Mysql

2014-06-20 Thread Tom Evans
On Fri, Jun 20, 2014 at 5:04 PM, Dariusz Mysior wrote: > But in mysite-mysite-settings.py in DATABASES I dont't have CONN_MAX_AGE and > in don't have in my general directory file my.cnf :/ Helpfully, mysql uses my.cnf to refer to a whole raft of different config files (or rather, multiple co

Re: Django Post Issue

2014-06-20 Thread Nikolas Stevenson-Molnar
The "name" attribute should be on the select tag. E.g: Foo _Nik On 6/20/2014 10:33 AM, G Z wrote: > I'm trying to post > customer_id > while generating a combo box with a loop from a database query. > I have the combo box generating and such, but the posted data does not > return the customer

Re: Django Post Issue

2014-06-20 Thread Tom Evans
On Fri, Jun 20, 2014 at 6:33 PM, G Z wrote: > I'm trying to post > customer_id > while generating a combo box with a loop from a database query. > I have the combo box generating and such, but the posted data does not > return the customer id. It returns something weird. > >> >> {% csrf_token %}

Re: Django Post Issue

2014-06-20 Thread G Z
Thanks lol its one of those days, I notice i was calling the options the name instead of the select. this might be a django ism but after i post the number and try to check it with an if statement it doesnt do anythign but if i print both out they are the same here is the code > {% if user.i

Re: Django Post Issue

2014-06-20 Thread G Z
solved it item.customer_id was a int post needed to be passed as an int.. On Friday, June 20, 2014 12:14:18 PM UTC-6, G Z wrote: > > Thanks lol its one of those days, I notice i was calling the options the > name instead of the select. > > > this might be a django ism but after i post the number

Re: Django Rest Framework create api-root ???

2014-06-20 Thread Glyn Jackson
The documentation explains this very well: http://www.django-rest-framework.org/tutorial/5-relationships-and-hyperlinked-apis -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send

unit test: AssertionError: 302 != 200

2014-06-20 Thread Kim
Hi everyone, I'm new to Django and am running a test. For my admintest in tests.py, I have the following: -- class AdminTest(LiveServerTestCase): def test_login(self): c = Client() response = c.get('/admin/') self.assertEquals(response.status_code,200)