pre-populate tabular inline in admin

2014-10-27 Thread carlos
Hi, i need pre-populete tabular inline in admin what is the best ways example class Options(models.Model): name = CharField(...) class ModelA(models.Model): option = FK(Options) field_1 = IntegerField() field_2 = IntegerField() field_3 = CharField() field_4 =

Re: TypeError: can't concat bytes to tuple

2014-10-27 Thread Vijay Khemlani
Well, this is not a Django-related question, but still. The tutorial you are following uses Python 2.5.1, which differs a lot from the Python 3.4 that you are using. If you want to still follow that tutorial you'd better install Python 2.7, which is more compatible with 2.5 Also, try printing

TypeError: can't concat bytes to tuple

2014-10-27 Thread Adarsh Sharma
Hi all, I am running below program : http://palewi.re/posts/2008/04/26/python-recipe-connect-to-mysql-database-execute-a-query-print-the-results/ on Centos 6.4 , Python 3.4 but not sure why it is failing with below exception : root@db2 bin]# python printfields_new.py datbase1 tb_sime_darby

Error was: No module named 'django.db.backends.pymysql'

2014-10-27 Thread Adarsh Sharma
Hi all, I am trying first example to run Python3.4 + Django 1.7 but not able to connect mysql.After reading few posts came to know that MysqlDB is not supported in Django1.7 So tried with pymysql and able to import [root@db1 mysite]# python Python 3.4.2 (default, Oct 24 2014, 01:36:10) [GCC

Re: AUTH_USER_MODEL does not accept sub application

2014-10-27 Thread Carl Meyer
On 10/27/2014 10:01 AM, Scot Hacker wrote: > > > On Monday, October 27, 2014 8:58:36 AM UTC-7, Scot Hacker wrote: > > > add2virtualenv /path/to/custom/apps/directory > > > > And when its time to deploy, you'll need to do similar on the server, > using an equivalent method in the wsgi

Re: AUTH_USER_MODEL does not accept sub application

2014-10-27 Thread Carl Meyer
Hi Frankline, On 10/27/2014 12:38 AM, Frankline wrote: > I am having problems with my custom user model while using Django 1.7.1 > and Python 3.4. > I have declared a Custom user model in an apps.users.AuthUser. I then > have another application (apps.pets) that will use the AuthUser as a >

Re: Django Project Website inaccesible

2014-10-27 Thread Dan
Thanks for all the replies. I have no problems connecting to anything else, only the Django Project site. At least I know now it's on my end. -- Dan -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop

Re: TEST_MIRROR not working?

2014-10-27 Thread Ilya Baryshev
I ended up opening a ticket https://code.djangoproject.com/ticket/23718 after fining my testcase actually works against Django 1.3.7 On Sunday, October 26, 2014 10:23:08 PM UTC+3, Ilya Baryshev wrote: > > >Ilya: Can you test if using TEST_MIRROR fixes the issue you are seeing? > Both settings

Re: django-forms-builder help

2014-10-27 Thread Stephen McDonald
Each Form and FieldEntry instance has corresponding Field instances - those are where the labels are stored. Each Field instances has a Form ID, and each FieldEntry instance has a Field ID. Your final code might end up pulling out all the Field instances in the view, passing them to the

Re: Django Project Website inaccesible

2014-10-27 Thread Jorge Andrés Vergara Ebratt
You can use something like http://www.downforeveryoneorjustme.com to see if web pages are really down or you can't enter. By the way, djangoproject.com is up & running On Oct 27, 2014 1:14 PM, "Tom Christie" wrote: > Seconding Larry. I don't see any issue. > > On Monday,

Re: Django Project Website inaccesible

2014-10-27 Thread Tom Christie
Seconding Larry. I don't see any issue. On Monday, 27 October 2014 18:06:17 UTC, Dan wrote: > > I've been trying to access https://www.djangoproject.com > > > since Friday, but no matter

Re: Django Project Website inaccesible

2014-10-27 Thread Huy T
Works for me and the SSL configuration is fine. Something on your end? On Mon, Oct 27, 2014 at 2:08 PM, Larry Martell wrote: > On Mon, Oct 27, 2014 at 2:06 PM, Dan wrote: > > I've been trying to access https://www.djangoproject.com since Friday,

Re: Django Project Website inaccesible

2014-10-27 Thread Larry Martell
On Mon, Oct 27, 2014 at 2:06 PM, Dan wrote: > I've been trying to access https://www.djangoproject.com since Friday, but > no matter what browser I use on server different systems the connection > fails. > > There appears to be something wrong the the SSL configuration at

Django Project Website inaccesible

2014-10-27 Thread Dan
I've been trying to access https://www.djangoproject.com since Friday, but no matter what browser I use on server different systems the connection fails. There appears to be something wrong the the SSL configuration at the main Django Project website. Does anyone know if someone is trying to

django-forms-builder help

2014-10-27 Thread Chris Meek
I have an app that uses django-forms-builder. I have got it to display the completed forms without the labels. How do I get it to match the labels next to the fields within my template. urls.py url(r'^forms/get/(?P\d+)/$', 'gws.views.form', name='form'), views.py def form(request,

Django model help text into database comment field

2014-10-27 Thread phillipe . cavalcante
Hello I would like to add help_text field value into the related database comment field. Is that possible? MODEL Table field = models.CharField(help_text=u'help text content', max_length=100, unique=False, blank=True, null=True) DATABASE Table field comment = help text content Cheers,

Re: AUTH_USER_MODEL does not accept sub application

2014-10-27 Thread Scot Hacker
On Monday, October 27, 2014 5:44:55 AM UTC-7, Collin Anderson wrote: > > Hi Frankline, > > Like you said, you need to use 'app_label.model_name' for AUTH_USER_MODEL, > instead of 'apps.app_label.model_name'. Django looks at INSTALLED_APPS and > knows to add the "apps" prefix when importing. >

Re: AUTH_USER_MODEL does not accept sub application

2014-10-27 Thread Scot Hacker
On Monday, October 27, 2014 8:58:36 AM UTC-7, Scot Hacker wrote: > > > add2virtualenv /path/to/custom/apps/directory > > > And when its time to deploy, you'll need to do similar on the server, using an equivalent method in the wsgi definition, e.g.: import os, sys, site

How to get rid of help text on a ModelForm?

2014-10-27 Thread Daniel Grace
Hi, I have a ModelForm for creating users, but it shows some help text "Required. 30 characters..." next to the username field. How do I get rid of this text? I tried the following, but the text remains on the form: class UserForm(forms.ModelForm): password =

Re: Slow SQL query

2014-10-27 Thread Erik Cederstrand
> Den 27/10/2014 kl. 14.55 skrev Collin Anderson : > > Hi Erik, > > No luck... > > mysql> show indexes in order_order; >

Re: Slow SQL query

2014-10-27 Thread Collin Anderson
Hi Erik, No luck... mysql> show indexes in order_order; +-++--+--++---+-+--++--++-+---+ | Table | Non_unique | Key_name | Seq_in_index

Re: Slow SQL query

2014-10-27 Thread Erik Cederstrand
> Den 27/10/2014 kl. 13.20 skrev Collin Anderson : > > mysql> explain SELECT COUNT(*) > -> FROM `order_order` > -> WHERE `order_order`.`status` != 4 > -> AND (`order_order`.`user_id` = 12345 OR `order_order`.`account_number` > -> = 123456); >

Re: AUTH_USER_MODEL does not accept sub application

2014-10-27 Thread Collin Anderson
Hi Frankline, Like you said, you need to use 'app_label.model_name' for AUTH_USER_MODEL, instead of 'apps.app_label.model_name'. Django looks at INSTALLED_APPS and knows to add the "apps" prefix when importing. What's wrong with setting AUTH_USER_MODEL to 'app_label.model_name'? Collin --

Re: Integer Form with Select Widget?

2014-10-27 Thread Collin Anderson
Hi Farhan, I can think of two ways. Either, like you said during form instantiation, do something like this: class DeleteUserForm(forms.Form): def __init__(self, data=None, choices=None, more_info=None): super(DeleteUserForm, self).__init__(data) widget =

Re: Slow SQL query

2014-10-27 Thread Collin Anderson
mysql> explain SELECT COUNT(*) -> FROM `order_order` -> WHERE `order_order`.`status` != 4 -> AND (`order_order`.`user_id` = 12345 OR `order_order`. `account_number` -> = 123456);

Re: View didn't return an HttpResponse object

2014-10-27 Thread Collin Anderson
Hello, The messages framework might be helpful here. from django.contrib import messages messages.add_message(request, messages.INFO, 'Password was changed') return logout_then_login(request, login_url='/login/') Logowanie na stronie Managera Piłkarskiego GoalKick {% for message in messages

AUTH_USER_MODEL does not accept sub application

2014-10-27 Thread Frankline
I am having problems with my custom user model while using Django 1.7.1 and Python 3.4. I have declared a Custom user model in an apps.users.AuthUser. I then have another application (apps.pets) that will use the AuthUser as a ForeignKey in a Pet model. See below: class Pet(models.Model):