Best Practices Django Questions

2015-01-30 Thread G Z
Hello, I'm in the design stages of a site that I'm building. It is going to be a basic social media site for a game I'm designing in unity. I'm not entirely sure how to do some of the things I want to in Django. Thus, my first question is generally best practices question as well as a how do I

Re: Best Practices Django Questions

2015-01-30 Thread G Z
class *User*(models.Model): id = models.*AutoField*(primary_key=True) username = models.CharField(max_length=4000) password = models.CharField(max_length=4000) email = models.CharField(max_length=4000) phone = models.CharField(max_length=4000) profile_image = models.FileField() about = mo

Re: Best Practices Django Questions

2015-01-30 Thread G Z
class User(models.Model): id = models.AutoField(primary_key=True) username = models.CharField(max_length=4000) password = models.CharField(max_length=4000) email = models.CharField(max_length=4000) phone = models.CharField(max_length=4000) profile_image = models.FileField()

Best Practices Model Design

2015-01-30 Thread G Z
Hello, I'm in the design stages of a site that I'm building. It is going to be a basic social media site for a game I'm designing in unity. I'm not entirely sure how to do some of the things I want to in Django. Thus, my first question is generally best practices question as well as a how do

CSRF token missing on file upload ajax request

2015-02-08 Thread G Z
hello, I have an ajax request that sends a file to django, it is saying that the csrf token is missing but i copied my other ajax request that are working. I'm sure it has something to do with trying to pass a file to upload. I get a 403 and csrf missing return. base.html

Advanced Query / Django Idiocy Question

2014-07-10 Thread G Z
Hello, I'm running a very complicated query against oracle to return some data. I'm running it manually because django can't natively do what I am doing from what I have read. I run the query but django doesn't get any values in return. I recently switched from my dev database to my production

Django Database Switching Issue

2014-07-11 Thread G Z
So I tracked down an issue, whenever I change my database from development to production which have the same exact schema it still uses the data from development although my settings.py file is set to the production database and it even swtiches the user I have to log in with to the one associat

Re: Django Database Switching Issue

2014-07-11 Thread G Z
1/14 9:27 AM, G Z wrote: > > So I tracked down an issue, whenever I change my database from > > development to production which have the same exact schema > > it still uses the data from development although my settings.py file > > is set to the production database and it

Re: Django Database Switching Issue

2014-07-14 Thread G Z
> > Thomas, > We are using an oracle database setup, we have a development database and a production database, the production database is for billing. The databases have the sane TNS resolver name of DB1. To test that it was using the correct settings.py file I removed the database information

Re: Django Database Switching Issue

2014-07-14 Thread G Z
I solved it thanks for all your help though. On Monday, July 14, 2014 9:44:31 AM UTC-6, G Z wrote: > > Thomas, >> > > We are using an oracle database setup, we have a development database and > a production database, the production database is for billing. > The dat

Django Models Issue with Oracle

2014-07-14 Thread G Z
I'm getting the following error while trying to access my licenses page from the admin panel. I have no idea why im getting the error. ORA-00904: "LICENSES"."CODE": invalid identifier Here is a describe of my current table: desc licenses Name

how do i return an int as the returned object for admin panel

2014-07-14 Thread G Z
how do I fix this? class Vm_licenses(models.Model): vm_license_id = models.BigIntegerField(primary_key = True, editable = False, db_column = 'vm_license_id') license= models.ForeignKey(License, on_delete = models.PROTECT) vm= models.ForeignKey(Vm, on_delete = models.PROTECT) class

Admin Page Customization Questions

2014-07-15 Thread G Z
I have a few questions, is it possible to template the admin page? second I'm trying to customize some of the individuals pages for my particular issue I have a table named vm_licenses and a licenses table, I have my models set up l

Re: Admin Page Customization Questions

2014-07-15 Thread G Z
Ive also tried class License(models.Model): license_id = models.BigIntegerField(primary_key = True, editable = False, db_column = 'license_id') license_authority = models.ForeignKey(License_authoritie, on_delete = models.PROTECT) product = models.CharField(max_length = 20) class

Django ManytoMany Relationships

2014-07-15 Thread G Z
I will start by saying I have an existing database, for the purpose of my question it has three tables: Vm Vm_licenses Licenses This database is per-existing before we decided to make a django web-portal. Basically licenses is a da

Re: Django ManytoMany Relationships

2014-07-15 Thread G Z
y join table in the > database. If you are using an unmanaged database then you will need to > create the intermediary table yourself. See the ManyToMany field reference > <https://docs.djangoproject.com/en/dev/ref/models/fields/#manytomanyfield> > > On Tuesday, July 15, 2014

Re: Django ManytoMany Relationships

2014-07-15 Thread G Z
Admin.py class vm_license_admin(admin.ModelAdmin): list_display = ('vm',) search_fields = ('vm__vm_name',) ordering = ('vm',) filter_horizontal = ('license',) admin.site.register(Vm_license, vm_license_admin) class License(models.Model): license_id = models.BigIntegerFie

Django Models PrimaryKey not incrimenting I dont understand this framework and the documentation is poorly written.

2014-07-15 Thread G Z
So I have a database that we are using to collect vm statistics. It is always running and writing to a django database. I built my models file to resemble the db. However I have run into quite a few issues. I was wondering if anyone else has run into these issues and found out how to solve them.

Re: Django Models PrimaryKey not incrimenting I dont understand this framework and the documentation is poorly written.

2014-07-15 Thread G Z
I can update items just not add them always the same error cannot insert null for the primary key -- 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 an email to django-use

Re: Django Models PrimaryKey not incrimenting I dont understand this framework and the documentation is poorly written.

2014-07-15 Thread G Z
insert NULL into ("DEV"."VM_LICENSES"."VM_LICENSE_ID") On Tuesday, July 15, 2014 4:09:29 PM UTC-6, Tom Evans wrote: > > On Tue, Jul 15, 2014 at 10:23 PM, G Z > > wrote: > > So I have a database that we are using to collect vm statistics. It

Re: Django Models PrimaryKey not incrimenting I dont understand this framework and the documentation is poorly written.

2014-07-15 Thread G Z
http://www.oracle.com/technetwork/articles/dsl/vasiliev-django-100257.html the guide I followed from oracle. On Tuesday, July 15, 2014 4:16:54 PM UTC-6, G Z wrote: > > Tom, > > It fails with both autofield and bigintergerfield > > class License(models.Model): >license_

Re: Django Models PrimaryKey not incrimenting I dont understand this framework and the documentation is poorly written.

2014-07-16 Thread G Z
so I added a db trigger in oracle and it still said the same thing when ever I tried to save the new addition. Also whenever I try to go to an existing vm the manytomany field throws an exception that table or view doesn't exist but when I goto add new it doesnt and the correct field is display

Re: Django Models PrimaryKey not incrimenting I dont understand this framework and the documentation is poorly written.

2014-07-16 Thread G Z
Percival/dp/1449364829/ > > Hope this helps > Frank > > > > Am 16.07.14 19:08, schrieb G Z: > > so I added a db trigger in oracle and it still said the same thing when > ever I tried to save the new addition. Also whenever I try to go to an > existing vm the manytomany f

Django Template Dir Question

2014-07-16 Thread G Z
My project structure goes *holon* * -holon* -settings.py -etc * -portal** -App name* * -static* css / images *-templates* -main site template files views.py urls.py etc * -templates* base.html

Re: Django Admin DB Error only when trying to delete an inserted record delete.

2014-07-16 Thread G Z
> > upon further investigation I found that inspectdb on the production > database only will output a models.py for the django tables, I need it to > output it for the entire schema like it did on the development database, > to prevent unessecary changes the premissions of the django user are r

Re: Django Admin DB Error only when trying to delete an inserted record delete.

2014-07-17 Thread G Z
Thanks, I am unable to solve this issue but im running it down. On Thursday, July 17, 2014 10:46:08 AM UTC-6, Michiel Overtoom wrote: > > > On Jul 16, 2014, at 23:14, G Z wrote: > > > So I'm still running in to issues using a prexisting database, ive > worked ou

Django and Python-Ldap with Active Directory Question

2014-07-17 Thread G Z
I'm using pure python-ldap to authenticate because django-auth-ldap doesn't work for some reason no matter how i tried it. settings.py AUTHENTICATION_BACKENDS = ( 'django.contrib.auth.backends.ModelBackend', 'holon.backend.ActiveDirectoryBackend', ) backend.py import ldap from portal.

Django/Python-ldap Ldap Question Adding Entries

2014-07-23 Thread G Z
I'm trying to add entries via a form post in django, I have the following code and its really not django specific but it is python-ldap specific. I'm trying to add entries with python ldap. I'm getting a naming convention error. My code is import ldap import ldap.modlist as modlist

I don't understand whats wrong with the way im passing django list to json

2014-07-28 Thread G Z
so I'm trying to display some vm performance data on javascript charts. It needs the information as a list, I have tried passing a json list from django and a django list like below in the javascript i ahve the one they tell me to use and the one im trying the one they tell me to use works obvi

Re: I don't understand whats wrong with the way im passing django list to json

2014-07-29 Thread G Z
> > Tom, I have done alot actually, I have put the data into a json array, a list, a tupple, a dictionary. I have tried the following: my data has been passed in every possible way I can think of. What I need to know how to do is convert a python list I pass with django to a javascript list b

Re: I don't understand whats wrong with the way im passing django list to json

2014-07-29 Thread G Z
fixed it i was passing strings and not integers var randomScalingFactor = function(){ return Math.round(Math.random()*100)}; var lineChartData = { labels : ["1000","2000","3000","4000","5000","6000","7000", "8000", "9000", "1", "11000", "12000", "13000", "14000", "15000",], datasets : [ { l

Re: I don't understand whats wrong with the way im passing django list to json

2014-07-29 Thread G Z
["2014-07-28 14:24:11", "2014-07-28 14:24:11"] On Monday, July 28, 2014 5:10:50 PM UTC-6, G Z wrote: > > so I'm trying to display some vm performance data on javascript charts. It > needs the information as a list, I have tried passing a json list from > d

Re: I don't understand whats wrong with the way im passing django list to json

2014-07-29 Thread G Z
the values will show how, but i ran into another problem while trying to input the labels, labels need to be strings so I input them as an array such as the following: ["2014-07-28 14:24:11", "2014-07-28 14:24:11"] I saved it as a simple json in django and pass it to the webbrowser and then con

Re: I don't understand whats wrong with the way im passing django list to json

2014-07-29 Thread G Z
etContext("2d"); window.myLine = new Chart(ctx).Line(lineChartData, { responsive: true }); } On Tuesday, July 29, 2014 9:47:40 AM UTC-6, G Z wrote: > > the values will show how, but i ran into another problem while trying to > input the labels, labels need to be strings so

How do I get Django to ignore javascript code because its throwing an exception

2014-07-30 Thread G Z
so im using the following java script var cpuChart = document.getElementById('cpu').getContext('2d'); new Chart(cpuChart).Line(cpuData,{ bezierCurve: false, datasetFill : false, legendTemplate : "-legend\"><% for (var i=0; i\"><%if(datasets[i].label){%><%=datasets[

Re: How do I get Django to ignore javascript code because its throwing an exception

2014-07-31 Thread G Z
sday, July 30, 2014 6:59:05 PM UTC-4:30, G Z wrote: >> >> so im using the following java script >> >> var cpuChart = document.getElementById('cpu').getContext('2d'); >> new Chart(cpuChart).Line(cpuData,{ >> bezierCurve: false,

Javascript loading while executing backend python query.

2014-08-04 Thread G Z
Hi I'm trying to write a loading script that displays a loading image while the django backend queries i have written are exectuting. This is to say i have some very complicated sql queries i call mannually with python by watching for specific post from the webpage to execute different queries.

Django POST Arrays

2014-08-07 Thread G Z
I'm doing some query and database stuff outside of what django is capable of and I need some help with how I get all the values of a POSTED Dictionary list. here is the POST values because im using a multiple select box that are send to django u'licenses': [u'26.0', u'16.0', u'13.0', u'166.0']

Re: Django POST Arrays

2014-08-11 Thread G Z
Thanks so much On Thursday, August 7, 2014 4:38:28 PM UTC-6, Tom Evans wrote: > > On Thu, Aug 7, 2014 at 10:27 PM, G Z > > wrote: > > I'm doing some query and database stuff outside of what django is > capable of > > and I need some help with how I get all the

Decrypting Encrypted Customer Data from Django Queries Not Working, But Working with Regular DB Queries

2014-10-08 Thread G Z
so I have a database of information with encrypted customer names. When I use a plain python script to decrypt the names it works correctly and decrypts all of the customer names. However, when I used Django it will decrypt only one name and the remaining names will still be encrypted. I encry

Re: Decrypting Encrypted Customer Data from Django Queries Not Working, But Working with Regular DB Queries

2014-10-08 Thread G Z
> Cal > > On Wed, Oct 8, 2014 at 11:11 PM, G Z > > wrote: > >> so I have a database of information with encrypted customer names. When I >> use a plain python script to decrypt the names it works correctly and >> decrypts all of the customer names. >> >

Re: Decrypting Encrypted Customer Data from Django Queries Not Working, But Working with Regular DB Queries

2014-10-08 Thread G Z
rting again from > scratch, comment/document as you go along, and then compare each step with > your working Python code to see where it's breaking. > > Cal > > On Wed, Oct 8, 2014 at 11:29 PM, G Z > > wrote: > >> How is encrypting at the application level wrong?

Re: Decrypting Encrypted Customer Data from Django Queries Not Working, But Working with Regular DB Queries

2014-10-08 Thread G Z
I'll post some more on this later, I'll post comments and be more descriptive. On Wednesday, October 8, 2014 4:56:27 PM UTC-6, G Z wrote: > > I know exactly what my code is doing, and it works in just python > something django is doing is screwing it up. > > On Wednes

How do I use a django join to select customer_name for every id that is returned in a result from a summary table?

2014-10-20 Thread G Z
I've been looking into django joins, and I can see how I can select related fields with .select_related but I can't seem to get it to work how I want. I basically have summary tables that are linked to the customers table with customer_id FK's, I want to select the customer name from the custome

Django and Ajax, Django not returning posted data.

2014-11-05 Thread G Z
So I'm trying to write an ajax script that post data to django without having to leave the page. Currently it is on submit however eventually im going to put it on a timer. Right now the function outputs to the console as a success but no data is returned from django. Here is my ajax $(docu

Re: Django and Ajax, Django not returning posted data.

2014-11-05 Thread G Z
Another note is I try to return posted data and out put it to the html for testing and that doesn't get returned either. -- 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 an e

Re: Django and Ajax, Django not returning posted data.

2014-11-05 Thread G Z
updated my ajax to the following but for somereason it just says something went wrong $(document).ready(function() { $('#get_info').submit(function() { $.ajax({ type: "POST", url: "/vmstatus/", dataType: "json", async:

Django URLs problem

2014-05-06 Thread G Z
drwxr-xr-x 4 root root 4096 May 5 20:12 . drwxr-xr-x 3 root root 4096 May 5 19:09 .. -rw-r--r-- 1 root root 255 May 5 19:09 manage.py drwxr-xr-x 2 root root 4096 May 5 22:51 provisioning drwxr-xr-x 3 root root 4096 May 5 22:22 vmware my project ursl is as follows from django.conf.urls impor

Urls.py Question

2014-05-06 Thread G Z
project name = provisioning app name = vmware In my projects urls.py I have the following. I assume I set the new url link customers to myapp.urls because im watching a youtube video and thats what he did. from django.conf.urls import patterns, include, url from django.contrib import admin ad

Django URLS help app not defined

2014-05-06 Thread G Z
project name = provisioning app name = vmware In my projects urls.py I have the following. I assume I set the new url link customers to myapp.urls because im watching a youtube video and thats what he did. from django.conf.urls import patterns, include, url from django.contrib import ad

Re: Django URLS help app not defined

2014-05-06 Thread G Z
splay data but its telling me vmware is undefined. On Monday, May 5, 2014 11:09:51 PM UTC-6, G Z wrote: > > project name = provisioning > app name = vmware > > In my projects urls.py I have the following. I assume I set the new url > link customers to myapp.urls because im watch

Re: Django URLS help app not defined

2014-05-06 Thread G Z
> > and yes vmware is defined in installed apps. > -- 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 an email to django-users+unsubscr...@googlegroups.com. To post to this gr

Re: Django URLS help app not defined

2014-05-06 Thread G Z
> > so in my project.urls file i put > from . import vmware do i have to add anything to my apps.urls because i got the following error after adding the folllowing from django.contrib import admin admin.autodiscover() from . import vmware urlpatterns = patterns('', # Examples: # url(

Models and Admin Site Question

2014-05-06 Thread G Z
so in my models .py file I have from django.db import models # Create your models here. class Customer(models.Model): NAME = models.CharField(max_length=200) WEBSITE = models.CharField(max_length=200) PHONE = models.CharField(max_length=200) EMAIL = models.CharField(max_length=

Re: Models and Admin Site Question

2014-05-06 Thread G Z
Thank you so much I dont know why i didnt catch that. Can you help me with my other post abotu urls? -- 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 an email to django-user

Re: Urls.py Question

2014-05-06 Thread G Z
I'm running 1.6.4 yes vmware is in my installed apps i used from . import vmware if I dont try to link my appurls to project urls and just use admin site all my stuff works correctly its just when i try to add vmare project.urls from django.conf.urls import patterns, include, url from django.

Django Linking Multiple Mysql tables with unique identifiers

2014-05-06 Thread G Z
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 Customer(models.Model): NAME = models.CharField(max_length=200) WEBSITE

Re: Django URLS help app not defined

2014-05-06 Thread G Z
> > I'm running 1.6.4 > > Project Structure Project name: provisioning App Name: vmware > /djangoprojects/provisioning/provisioning/urls.py > > > from django.conf.urls import patterns, include, url > > from django.contrib import admin > admin.autodiscover() > from . import vmware > > urlpatte

Re: Django URLS help app not defined

2014-05-06 Thread G Z
wrong? On Monday, May 5, 2014 11:09:51 PM UTC-6, G Z wrote: > > project name = provisioning > app name = vmware > > In my projects urls.py I have the following. I assume I set the new url > link customers to myapp.urls because im watching a youtube video and thats >

Re: Django URLS help app not defined

2014-05-06 Thread G Z
> > in fact here is the tutorial series I was following > https://www.youtube.com/watch?v=KqN4u28T-JQ&list=PLQVvvaa0QuDcTDEowl-b5nQlaDaD82r_s -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving e

Re: Django URLS help app not defined

2014-05-06 Thread G Z
> > Whats wrong with this > from django.conf.urls import patterns, include, url from django.view.generic import ListView from vmware.models import Customer urlpatterns = patterns(' ', url(r'^customers/', ListView.as_view( queryset=Customer

Re: Django URLS help app not defined

2014-05-06 Thread G Z
> > 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/ 2. ^customers/ The current URL, customers, didn't mat

Re: Django URLS help app not defined

2014-05-06 Thread G Z
The admin page works fine only the other two don't Project Structure Project Root Directory: provisioning/ this is where manage.py lives Project Settings Directory provisioning/provisioning/settings.py App Directory provisioning/vmware template directory /provisioning/vmware/templates/ th

Re: Django URLS help app not defined

2014-05-06 Thread G Z
url(r'^', ListView.as_view( queryset=Customer.objects.all().order_by("-id")[:100], template_name="vms.html")), ) On Monday, May 5, 2014 11:09:51 PM UTC-6, G Z wrote: > > project name = provisioning > app name = vmware &

Re: Django URLS help app not defined

2014-05-06 Thread G Z
yea the admin works perfectly fine no issues. On Monday, May 5, 2014 11:09:51 PM UTC-6, G Z wrote: > > project name = provisioning > app name = vmware > > In my projects urls.py I have the following. I assume I set the new url > link customers to myapp.urls because im watchi

Re: Django Linking Multiple Mysql tables with unique identifiers

2014-05-06 Thread G Z
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 admin panel and try to add vmspecs to vms after connecting the

regex error?

2014-05-06 Thread G Z
Im using detailview to display customer individualy when the link is clicked on but its not recognizing the number i think my regex is wrong.. this is what i have from django.conf.urls import patterns, include, url from django.views.generic.list import ListView from django.views.generic.detail

Re: regex error?

2014-05-06 Thread G Z
ive also tried url(r'^customers/([0-9])/$', DetailView.as_view( model = Customer, template_name="customer.html")), -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group

Detail View Question

2014-05-06 Thread G Z
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 customer data. The data exist at domain/customers/ however when you click the link which takes

Re: Detail View Question

2014-05-06 Thread G Z
repost easier to read 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 customer data. The data exist at domain/customers/ however when you cl

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&

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 > > # Cre

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

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: 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 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

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 &

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 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 tr

Re: Python Nested For Looping MultiTable Association Question

2014-05-08 Thread G Z
{% for e in customers %} {% for d in vms %} {% if e.id = d.CUSTOMERID %} {{ e.id }} - {{ e.NAME }} - {{ d.VMNAME }} {% endif %} {% endfor %} {% endfor %} why doesn't this work.? -- You rec

Re: Python Nested For Looping MultiTable Association Question

2014-05-08 Thread G Z
outside the if statement the data appears.. -- 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 an email to django-users+unsubscr...@googlegroups.com. To post to this group, sen

Django Template Based If Statement Issue

2014-05-12 Thread G Z
Views.py 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 = Vms.objects.all

Re: Django Template Based If Statement Issue

2014-05-12 Thread G Z
I'm just trying to associate each vm tied to the customers id and display the vms under the customer that are associated with his id. On Monday, May 12, 2014 3:02:34 PM UTC-6, G Z wrote: > > Views.py > > > from django.shortcuts import render > from django.http imp

Re: Django Template Based If Statement Issue

2014-05-12 Thread G Z
but i didn't quite understand waht the documentation was sayign On Monday, May 12, 2014 3:02:34 PM UTC-6, G Z wrote: > > Views.py > > > from django.shortcuts import render > from django.http import HttpResponse > from vmware.models import Customer >

Re: Django Template Based If Statement Issue

2014-05-12 Thread G Z
Evans wrote: > > On Mon, May 12, 2014 at 10:47 PM, G Z > > wrote: > > I'm just trying to associate each vm tied to the customers id and > display > > the vms under the customer that are associated with his id. > > > > Normally, you would have some

Re: Django Template Based If Statement Issue

2014-05-12 Thread G Z
also thank you so much for your help. On Monday, May 12, 2014 4:00:27 PM UTC-6, Tom Evans wrote: > > On Mon, May 12, 2014 at 10:47 PM, G Z > > wrote: > > I'm just trying to associate each vm tied to the customers id and > display > > the vms under the customer

Re: Django Template Based If Statement Issue

2014-05-12 Thread G Z
> > ok its still not putting out the vm data i get Grant - google.com - 7029855378 - zuk...@gmail.com - 2332 oakland st - - {% for customer in customers %} {{ customer.NAME }} - {{ customer.WEBSITE }} - {{customer.PHONE}} - {{ customer.EMAIL }} - {{ customer.

Adding Forms with ModelForm and Writing Data

2014-05-13 Thread G Z
I'm trying to follow the documentation on using forms to save data tot he database. vmware is my app name. Nothing is showing up on my index page though. I'm not sure why can anyone help me the documentation isn't clear it bounces everywhere between two different methods without really defining

Re: Adding Forms with ModelForm and Writing Data

2014-05-13 Thread G Z
> > so I changed my code into 3 parts. If I understood the documentation right > this should create a form based on the Customer model in models.py and > display it on my index.html > *forms.py* from django import forms from .models import Customer class SignUpForm(forms.ModelForm):

Django Form Question, Last Post Wasn't Formatted Correctly So I Deleted and Made a New One.

2014-05-13 Thread G Z
> > Below is my code. I am trying to generate a customer signup form from the > Customer model in the models.py file. > Below I have created forms.py which is the script that will generate the form data based on what is in the models.py file. Then in views. I call that forms.py file to run and d

Re: Django Form Question, Last Post Wasn't Formatted Correctly So I Deleted and Made a New One.

2014-05-14 Thread G Z
> > how do i do that? > -- 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 an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-u

Re: Django Form Question, Last Post Wasn't Formatted Correctly So I Deleted and Made a New One.

2014-05-14 Thread G Z
(loader.render_to_string(*args, **kwargs), **httpresponse_kwargs) File "/usr/local/lib/python2.7/dist-packages/django/template/loader.py" in render_to_string 171. context_instance.pop() Exception Type: TypeError at / Exception Value: pop expected at least 1 arguments, got 0 O

Re: How do I post into database the input form form fields

2014-05-14 Thread G Z
https://www.youtube.com/watch?v=f0uZqPNijCw but im having issues displaying form.. On Wednesday, May 14, 2014 2:25:09 AM UTC-6, x_marine wrote: > > Hi, > > I have been working on a project that works with prefilled form fields in > html. > > I wonder how this can integrated into Django Models

csrf question

2014-05-14 Thread G Z
So I read the documentation on passing csrf tokens, however its giving me an issue i think its because im trying to pass it as a dictonary variable with my form and customers. This is from the documentation from django.views.decorators.csrf import csrf_protectfrom django.shortcuts import rende

Re: Django Form Question, Last Post Wasn't Formatted Correctly So I Deleted and Made a New One.

2014-05-14 Thread G Z
ender_to_response('index.html', ctx) > > On Wednesday, May 14, 2014 3:22:22 PM UTC-7, G Z wrote: >> >> def index(request): >> form = SignUpForm(request.POST or None) >> if form.is_valid(): >> save_it = form.save(co

Re: csrf question

2014-05-15 Thread G Z
documentation and its not working. I tried what you suggested removing the declaration no luck. On Thursday, May 15, 2014 8:12:33 AM UTC-6, donarb wrote: > > On Wednesday, May 14, 2014 11:35:46 PM UTC-7, G Z wrote: >> >> So I read the documentation on passing csrf tokens, how

Re: csrf question

2014-05-15 Thread G Z
solved it 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 from .forms import SignUpForm from vmware.models import Vmspecs from django.views.decorators.csrf imp

Multiple Model Form Generation

2014-05-15 Thread G Z
I want to call three models into one form on my page but it doens't like the way that i am doing it. Any help would be awesome if i call them idividually it just displaces the last one i call. from django import forms from .models import Customer, Vms, Vmspecs class SignUpForm(forms.ModelForm

Re: Multiple Model Form Generation

2014-05-15 Thread G Z
> > so I changed it a bit after doing some more research however formb, and > formc don't display, if I change the 'formb' to 'form' it will overwrite > the first one and only display the second one. > This is how i read the forignekey associate between multiple forms to be. > from django.sho

Importing Existing Oracle Databases

2014-05-16 Thread G Z
Hello, I've been looking online how to build a model in models.py of an existing outside database. We developed and application in python, and I need to import its data from an oracle database. However I tried this before by establishing the fields in models.py to what the database says and run

  1   2   >