Re: django on rhel5 with both python2.4 and python2.7 confusion

2014-05-07 Thread Kelvin Wong
Question one... The gist is: 1. Set up Virtualenv and Virtualenvwrapper (lots of howtos on the web for this - find one written in the last year) 2. Set correct environment keys to point to the right Python (similar to the following, you paths may be different) # ~/.bashrc export VIRTUALENVWRAP

Re: What is different of handling character code between pure Python and Django?

2014-05-07 Thread Sugita Shinsuke
Hello Tom Evans > plain single and double quotes - " and ', not “ and ‘. My e-mail client is Gmail web client. >What version of Python? 2.x or 3.x? Python version is 2.7.5 And, Django version is 1.3.7 >There was an old case to force Django to use UTF-8: I added sys.stdout = codecs.getwriter

Re: Install Django debug toolbar - Error Path

2014-05-07 Thread Venkatraman S
On Wed, May 7, 2014 at 10:48 PM, Rafael Santos wrote: > Python Version: 2.7.6 > Django Version: 1.6.4 > > > Traceback: > File "C:\Python27\lib\site-packages\django\core\handlers\base.py" in > get_response > 201. response = middleware_method(request, response) > File "C:\Python27\

Re: Python Nested For Looping MultiTable Association Question

2014-05-07 Thread G Z
by the way if someone could help me understand what the docs are saying about doing this in views that would be awesome. On Wednesday, May 7, 2014 11:35:21 AM UTC-6, G Z wrote: > > I'm new to django so im assuming there is an easier way to do this but in > my html template im trying to do the fo

Re: Python Nested For Looping MultiTable Association Question

2014-05-07 Thread G Z
ok so I added == to my if statement and independently verified that the values were displaying and are correct. So I was wrong though .id is not .CUSTOMERID because I returned self.name for the customer model it needs to match the strings so i have {% for e in customers %}

Re: Python Nested For Looping MultiTable Association Question

2014-05-07 Thread Sylvain GROS-DESORMEAUX
use == instead of = in your if statement. On Wed, May 7, 2014 at 4:18 PM, G Z wrote: > out of my stupidity i refined it a bit > > {% for e in customers %} > {% for d in vms %} > {% if e.id = d.CUSTOMERID %} > {{

Re: Django Linking Multiple Mysql tables with unique identifiers

2014-05-07 Thread G Z
Thanks that worked. On Tuesday, May 6, 2014 11:34:51 AM UTC-6, G Z wrote: > > So I'm trying to set up my django app and I want to link multiple tables > each with a unique key identifier. To test this i have the following > models. py > > from django.db import models > > # Create your models he

Re: Python Nested For Looping MultiTable Association Question

2014-05-07 Thread G Z
I read that but didn't quite get how to return the values the way I want.. On Wednesday, May 7, 2014 11:35:21 AM UTC-6, G Z wrote: > > I'm new to django so im assuming there is an easier way to do this but in > my html template im trying to do the following > > I have a customer that has vmids a

FormWizard confirmation step logic and Allow dynamic form classes with WizardView

2014-05-07 Thread Fabio Caritas Barrionuevo da Luz
Hello django users. About the ticket 21644[1] - "FormWizard needs confirmation step logic" and ticket 21667[2] - "Allow dynamic form classes with WizardView" I would like your opinions about the proposed implementation by user nickname123[3]. Remember that an implementation is in very early st

Re: Python Nested For Looping MultiTable Association Question

2014-05-07 Thread Rafael E. Ferrero
https://docs.djangoproject.com/en/dev/topics/db/queries/#retrieving-all-objects -- Rafael E. Ferrero 2014-05-07 16:54 GMT-03:00 G Z : > I don't know why this isn't working.. > > > from django.shortcuts import render > from django.http import HttpResponse > from vmware.models import Customer > f

Re: Python Nested For Looping MultiTable Association Question

2014-05-07 Thread G Z
out of my stupidity i refined it a bit {% for e in customers %} {% for d in vms %} {% if e.id = d.CUSTOMERID %} {{ e.id }} - {{ e.NAME }} - {{ d.VMNAME }} {% endif %} {% e

Re: Python Nested For Looping MultiTable Association Question

2014-05-07 Thread G Z
I don't know why this isn't working.. from django.shortcuts import render from django.http import HttpResponse from vmware.models import Customer from django.shortcuts import render_to_response from vmware.models import Vms def index(request): customers = Customer.objects.all vms

Re: Django Linking Multiple Mysql tables with unique identifiers

2014-05-07 Thread Daniel Roseman
On Tuesday, 6 May 2014 23:06:16 UTC+1, G Z wrote: > > Easier to be red > > Ok so I have three tables in my database Customer Vms and Vmspecs > > Vms is tied through customer by customer id through database id field and > vmspecs is tied to vms through the id field for Vms. However when I go into

Error in Django debug toolbar

2014-05-07 Thread Rafael Santos
INSTALLED_APPS += ( 'debug_toolbar', ) MIDDLEWARE_CLASSES += ( 'debug_toolbar.middleware.DebugToolbarMiddleware', ) INTERNAL_IPS = ('127.0.0.1',) Environment: Request Method: GET Request URL: http://127.0.0.1:8000/Aula10/ Django Version: 1.6.4 Python Version: 2.7.6 Installed Applications: (

Install Django debug toolbar - Error Path

2014-05-07 Thread Rafael Santos
Python Version: 2.7.6 Django Version: 1.6.4 I installed the debug toolbar = pip install django-debug-toolbar, that's ok. Add: INSTALLED_APPS += ( 'debug_toolbar', ) MIDDLEWARE_CLASSES += ( 'debug_toolbar.middleware.DebugToolbarMiddleware', ) INTERNAL_IPS = ('127.0.0.1',) In execution time h

Python Nested For Looping MultiTable Association Question

2014-05-07 Thread G Z
I'm new to django so im assuming there is an easier way to do this but in my html template im trying to do the following I have a customer that has vmids associated with that and i want to match up every vm in the table vms by id to the vmids tag associated with the customer and display each on

Django rest framework api versioning

2014-05-07 Thread Стас Медведев
I'm new to the DRF. I tried to write an example by description on links: http://james.lin.net.nz/2014/02/18/django-rest-framework-api-versioning/ django-rest-framework: api versioning and share it: https://githu

Re: Django URLS help app not defined

2014-05-07 Thread Tom Evans
On Tue, May 6, 2014 at 9:40 PM, G Z wrote: > Thanks so much one last thing >> > > Page not found (404)Request Method:GETRequest URL: > http://pythondev.enki.co:8001/customers > > Using the URLconf defined in provisioning.urls, Django tried these URL > patterns, in this order: > >1. ^admin/ >

Re: What is different of handling character code between pure Python and Django?

2014-05-07 Thread Tom Evans
On Sun, Apr 27, 2014 at 7:13 AM, Sugita Shinsuke wrote: > Hi there > > I’d like to run Java code via Django. > > The Java code, javaprogram use like below. > > — > java javaprogram [text] [file_name] > — > > text is parameter. multi-byte character is also okey. > file_name is generate file name. >

Re: What is different of handling character code between pure Python and Django?

2014-05-07 Thread Sugita Shinsuke
Hello Lloyd Dube I fix 'utf8' to 'utf-8'. But, same error happned. ascii' codec can't decode byte 0xe3 in position 0: ordinal not in range(128) "locale.getpreferredencoding() is ANSI_X3.4-1968" is not the cause? 2014年5月7日水曜日 0時20分03秒 UTC+9 Lloyd Dube: > > That should be ".encode('utf-8') - it i

Re: Django Linking Multiple Mysql tables with unique identifiers

2014-05-07 Thread G Z
Anyone? On Tuesday, May 6, 2014 11:34:51 AM UTC-6, G Z wrote: > > So I'm trying to set up my django app and I want to link multiple tables > each with a unique key identifier. To test this i have the following > models. py > > from django.db import models > > # Create your models here. > class

Re: Detail View Question

2014-05-07 Thread G Z
Thanks so much that worked. On Tuesday, May 6, 2014 5:21:35 PM UTC-6, G Z wrote: > > So I'm using DetailView to associate a Customer ID with customer > information but due to my lack of knowledge im not entirely sure what the > issue is. It will go to the page but it won't load the unique custom

Re: query on models

2014-05-07 Thread Rafael E. Ferrero
I'll recommend you to read https://docs.djangoproject.com/en/dev/ref/models/querysets/ Cheers! -- Rafael E. Ferrero 2014-05-07 12:03 GMT-03:00 Anushree Jangid : > no no you are not missing anything. You got it right and I did that in > view and it worked. Actually I am new to Django. Thanks a

Re: query on models

2014-05-07 Thread Anushree Jangid
no no you are not missing anything. You got it right and I did that in view and it worked. Actually I am new to Django. Thanks a lot. On Wed, May 7, 2014 at 8:28 PM, Rafael E. Ferrero wrote: > You are using Ques for related Subject and QuestionBank... just make a > method in Ques class who fil

Re: query on models

2014-05-07 Thread Rafael E. Ferrero
You are using Ques for related Subject and QuestionBank... just make a method in Ques class who filter the Ques model with some subject parameter or do it in your view like: qs = Ques.objects.select_related().filter(subject='some_name') I'm missing something really big? or i miss understud you

Re: regex error?

2014-05-07 Thread Sergiy Khohlov
try this one url(r'/(?P\d+)$', DetailView.as_view( model = Customer, template_name="customer.html")), Many thanks, Serge +380 636150445 skype: skhohlov -- You received this message because you are subscribed to the Google Groups "Django users

Re: Centos 6.5 Python 3.3.x Django 1.6 Apache 2.2

2014-05-07 Thread Guillem Liarte
Timothy, Thanks you, but SELinux here does not seem to be the issue. I tried with enforcing/permissive/disabled and the effect is the same. I belive the problem to be in the os path in the seetings: --- import os BASE_DIR = os.path.dirname(os.path.dirname(__file__)) ... ...

Re: query on models

2014-05-07 Thread Anushree Jangid
No I start with subject model. There I have created subjects like General knowledge, English etc. ​Then I create question banks Like for General knowledge I have created GK1, GK2 and GK3 . Then when I enter a ques in the Ques model there I specify that the question is related to which subject and w

Re: query on models

2014-05-07 Thread Davide Scatto
Do you start from Ques model? What are your starting data? Il giorno mercoledì 7 maggio 2014 15:24:38 UTC+2, Anushree ha scritto: > > I have the following models. I want to retrieve list of question banks > related to a particular subject. Is it possible to do without modifying the > existing da

Re: About django round-up display function of time

2014-05-07 Thread Mario Gudelj
I assume you're using datetime object in which case you have a look at this SO answer http://stackoverflow.com/questions/3463930/how-to-round-the-minute-of-a-datetime-object-python On 7 May 2014 17:55, hito koto wrote: > Hi , good afternoon! > > I want to the round-up display function of time,

Re: query on models

2014-05-07 Thread Rafael E. Ferrero
Just filtering Ques model (imho) -- Rafael E. Ferrero 2014-05-07 10:24 GMT-03:00 Anushree : > I have the following models. I want to retrieve list of question banks > related to a particular subject. Is it possible to do without modifying the > existing data models?Thank you > class Subject(mod

query on models

2014-05-07 Thread Anushree
I have the following models. I want to retrieve list of question banks related to a particular subject. Is it possible to do without modifying the existing data models?Thank you class Subject(models.Model): name = models.CharField(max_length = 255) desc = models.TextField(blank=True) def __unicod

Re: django on rhel5 with both python2.4 and python2.7 confusion

2014-05-07 Thread Timothy W. Cook
A good place to start is with this thread: https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/django-users/_0RTNcYyCSI/24QinBTEnX8J Be sure to include CentOS in your searches for clues about this setup since many people use CentOS instead of RHEL. HTH, Tim On Wed, May 7,

Django calendar error

2014-05-07 Thread hito koto
I hava also have some error , Why ? i did import calendar! ViewDoesNotExist at /admin/auth/user/ Could not import tcsarticle.views.calendar. View is not callable. Request Method: GET Request URL: http://admin/auth/user/ Django Version: 1.6.2 Exception Type: ViewDoesNotExist Exception Va

html email function to a large recipient list problem

2014-05-07 Thread MikeKJ
I have these functions to send update emails to a subscriber list (recipients) but for some reason I cannot seem to fathom it does: Connect Send Email A Connect Connect Send Email B Send Email B Connect Connect Connect Send Email C Send Email C Send Email C etc etc Can anyone see where the in

Re: Detail View Question

2014-05-07 Thread visionary800
I am not sure my first reply worked, but here it goes again. Your template is using {{ post.NAME }} when I believe it should be using {{ customer.NAME }}. The context name that is used in the template is obtained by default from the model and in your case, you are using model= Customer. If you

django on rhel5 with both python2.4 and python2.7 confusion

2014-05-07 Thread David Malcolm
I have been tasked with finishing a build for production that was interrupted due to another staff member leaving at short notice. It's RedHat Enterprise Linux 5 and there are two versions of python on the box. If I type python I get version 2.7. However if I try and use django-admin.py I find

About django round-up display function of time

2014-05-07 Thread hito koto
Hi , good afternoon! I want to the round-up display function of time, how do i can do it , please help me!! (Django/Python) For example: 2, 09:30 minute = 09:40 09:15minute= 09:45 09:30minute= 10:00 09:31minute = 09:31 -- You received this message because you are subscribed to th

django-smart-selects ModelForm Issue

2014-05-07 Thread Venkatraman S
Hi, In the context of using django-smart-selects: as anyone stumbled on an issue with a Model using ChainedFK and if the queryset of chained_field in the ModelForm is changed before rendering? ie., if person is the chained_field in my form and I c