"Stupid newbie" question - why does this IntegrityError happen?

2009-09-03 Thread Johnson Earls
I've got the following models defined: class FeatureType(models.Model): type = models.CharField(max_length=20) def __unicode__(self): return self.type class Feature(models.Model): value = models.CharField(max_length=200) type = models.ForeignKey(FeatureType) def

Newbie Django project, suggestions for code improvement?

2009-08-26 Thread Matt Conrad
I wrote a little concentration game in Django and put it up on Google App Engine: http://matt-scratch.appspot.com/ I'm sure there are some awkward places in the code where I could leverage Django better. If anyone is curious and would like to comment or make suggestions, the source code

Re: Newbie - Model column arithmetic

2009-08-24 Thread Ken
Excellent. Many thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to

Re: Newbie - Model column arithmetic

2009-08-24 Thread Daniel Roseman
On Aug 24, 6:12 pm, Ken wrote: > Apologies if this is in an FAQ somewhere, but I've been unable to find > it... > > As a complete newcomer to Django (and Python, for that matter), I'd > like to present my users with an HTML table that contains columns a, b > and c from my

Newbie - Model column arithmetic

2009-08-24 Thread Ken
Apologies if this is in an FAQ somewhere, but I've been unable to find it... As a complete newcomer to Django (and Python, for that matter), I'd like to present my users with an HTML table that contains columns a, b and c from my table in the database, and then do arithmetic on the Model columns

Re: newbie help: how to list, list, detail

2009-08-22 Thread Daniel Roseman
On Aug 22, 8:29 pm, justin jools wrote: > key is used in replacement of 'id' in Google app engine (patch) > Essentially this doesnt matter, assume it is id in normal django. > I would just like to know how to do a list, list, detail query. When I > pass the id from

Re: newbie help: how to list, list, detail

2009-08-22 Thread justin jools
key is used in replacement of 'id' in Google app engine (patch) Essentially this doesnt matter, assume it is id in normal django. I would just like to know how to do a list, list, detail query. When I pass the id from first list to query a second list in a different table: i.e. first list/table

Re: newbie help: how to list, list, detail

2009-08-22 Thread Daniel Roseman
On Aug 22, 6:08 pm, justin jools wrote: > how can I show a list then pass the id to next list lookup then > detail? > > basically I'm writing a car product database with make, type and model > tables: > > so first list is Audi, BMW, Ford... the next list is e.g. Audi

newbie help: how to list, list, detail

2009-08-22 Thread justin jools
how can I show a list then pass the id to next list lookup then detail? basically I'm writing a car product database with make, type and model tables: so first list is Audi, BMW, Ford... the next list is e.g. Audi models: T100, Quattro, then last selection is detail. I used this view model and

generic view list_detail: how do I pass id to another list? newbie help please!

2009-08-20 Thread justin jools
generic view list_detail: how do I pass id to another list? (I'm using google app engine patch) Ive defined my first view as follows: def list_make(request): return object_list(request, Product_Make.all()) which works fine, now I want to pass the id selection to another list on a different

Re: Newbie - question - Django Tutorials 2

2009-08-15 Thread Daniel Roseman
On Aug 15, 11:22 am, salai wrote: > Dear Léon, > > Thankyou. > > hmm.. It is strange.! ( indentation error)! > >  But, after restarting the server, my Polls APP is not in admin area >  loaded. It always happened, when I got an error message. > >  many thanks in advance, > >  

Re: Newbie - question - Django Tutorials 2

2009-08-15 Thread salai
Dear Léon, Thankyou. hmm.. It is strange.! ( indentation error)! But, after restarting the server, my Polls APP is not in admin area loaded. It always happened, when I got an error message. many thanks in advance, regards, koko On Fri, Aug 14, 2009 at 11:58 PM,

Re: Newbie - question - Django Tutorials 2

2009-08-14 Thread salai
On Fri, Aug 14, 2009 at 11:22 PM, Léon Dignòn wrote: > > As it sais it's an indentation error. Instead you must write: >>     inlines = [ChoiceInline] >>     list_display = ('question','pub_date')  #line 16 >> >>     admin.site.register(Poll, PollAdmin) > Thankyou. hmm..

Re: Newbie - question - Django Tutorials 2

2009-08-14 Thread Léon Dignòn
As it sais it's an indentation error. Instead you must write: > inlines = [ChoiceInline] > list_display = ('question','pub_date') #line 16 > > admin.site.register(Poll, PollAdmin) On Aug 14, 10:53 pm, koko wrote: > Dear All, > > I just start Django today and

Newbie - question - Django Tutorials 2

2009-08-14 Thread koko
Dear All, I just start Django today and very enjoy with Django. I have some trouble with Django Official Docs Tutorial 2 from http://docs.djangoproject.com/en/dev/intro/tutorial02/ here is the error message. Can you help, what I do wrong here? IndentationError at /admin/ unexpected indent

Re: Django, CMS, CSS newbie question

2009-08-13 Thread Matthias Kestenholz
On Thu, Aug 13, 2009 at 11:55 PM, eldonp2 wrote: > > Thanks. > > I've gone through the book and done the tutorial on djangoproject.com > > Basically, my qyestion is still not answered - how do I start with a > CSS template and bring Django and Django-CMS in afterward? The

Re: Django, CMS, CSS newbie question

2009-08-13 Thread eldonp2
Thanks. I've gone through the book and done the tutorial on djangoproject.com Basically, my qyestion is still not answered - how do I start with a CSS template and bring Django and Django-CMS in afterward? The problem is with learning Python, HTML and Django, it will take a long time before I

Quick Newbie Question - reverse ManyToMany in admin site

2009-08-12 Thread ben
Hi all, I've got a model with a plain many-to-many relationship (no intermediate model) and want to edit the relationships in the admin site. By default the multiple select box only appears on the admin page for the model that defined it, however I'd like to be able to modify the relationships

newbie queryset question

2009-08-11 Thread joep
I have a model which contains a list of users and a list of groups that can access the model, e.g,, readers = models.ManyToManyField(User, blank=True, null=True,) reader_groups = models.ManyToManyField(Group, blank=True, null=True,) where User and Group are the standard django auth

Re: django newbie, having problems with my first app. maybe in the urls.py?

2009-08-11 Thread ezulo...@gmail.com
AHA, both of those were the problem :) got my hello world working, im sure i'll have many more questions! Thanks!!! On Aug 10, 5:06 am, gumbah wrote: > Whoops... i see now that it never even finds your urs.py so it must be > something wrong with the configuration on

Re: Django, CMS, CSS newbie question

2009-08-11 Thread Juan Hernandez
you can start here www.djangobook.com On Tue, Aug 11, 2009 at 10:58 AM, eldonp2 wrote: > I would like to start my own website. I > figured, since I don't know much, that I would start with a CSS > template and work back. How can I use a free template and then > integrate

Django, CMS, CSS newbie question

2009-08-11 Thread eldonp2
Hi, I'm new to programming. I would like to start my own website. I figured, since I don't know much, that I would start with a CSS template and work back. How can I use a free template and then integrate Django-Cms and Django into it? Thanks alot. Eldon

Re: django newbie, having problems with my first app. maybe in the urls.py?

2009-08-10 Thread gumbah
Whoops... i see now that it never even finds your urs.py so it must be something wrong with the configuration on webfaction... you have to look into your /webapps/PROJECT_NAME/apache/conf/ httpd.conf file to see if everything is setup correctly. On Aug 10, 12:01 pm, gumbah

Re: django newbie, having problems with my first app. maybe in the urls.py?

2009-08-10 Thread gumbah
I read "from mysite.views import hello " in your code... are you sure your webapp is in the "mysite" folder? best regards On Aug 10, 1:45 am, "ezulo...@gmail.com" wrote: > So i am very new to django and have a little python experience. im > using webfraction to host my

Re: django newbie, having problems with my first app. maybe in the urls.py?

2009-08-10 Thread Sujan Shakya
I m not sure if webfaction automatically deploy your django application, but I guess to need to configure server settings. For instructions on deploying http://docs.djangoproject.com/en/dev/howto/deployment/#howto-deployment-index --~--~-~--~~~---~--~~ You

django newbie, having problems with my first app. maybe in the urls.py?

2009-08-09 Thread ezulo...@gmail.com
So i am very new to django and have a little python experience. im using webfraction to host my application and followed their instructions on starting a django webapp. i have the server up and running and im using the 1.0 documentation at djangobook.com, and running django 1.0 for my webapp. I

Re: Getting Started, tutorial newbie

2009-08-06 Thread zignorp
figured it out, but I'm not sure I can articulate what I did. I had to start the shell first, then import my model. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send

Getting Started, tutorial newbie

2009-08-06 Thread zignorp
Hello, I'm going through the tutorial when I have time. A few weeks back, I created the polls app, was able to retrieve data and use the admin interface and everything was beautiful. Now I'm trying to catch up where I left off and am having problems. When I do the runserver command, it tells

Re: newbie tutorial part 1 startproject doesn't create folder and appropriate files

2009-08-04 Thread ondrey
Hi mdsmoker, try running the django-admin.py script like this: python PATH/django-admin.py startproject mysite where PATH is the path to directory containing the django-admin.py. -Ondrej Bohm On Aug 2, 11:47 pm, mdsmoker wrote: > I'm using django 1.1, python 2.5,

Re: newbie tutorial part 1 startproject doesn't create folder and appropriate files

2009-08-03 Thread Peter Bengtsson
Look at if perhaps the project "mysite" was created somewhere else, like for example where the django-admin.py file is located. If so, there could be a fundamental problem with your setup or a bug in the windows implementation for django-admin.py At worst, search your whole hard drive for it. On

Re: Django newbie deployment question

2009-08-02 Thread Ankur Gupta
Thanks prabhu, Your answer is bang on target. Thanks :). On Aug 2, 4:43 am, prabhu S wrote: > Your apache server would run as www user. Where as you have saved your > project in /root with root as the owner. To do this properly, do not > save your django project in /root.

newbie tutorial part 1 startproject doesn't create folder and appropriate files

2009-08-02 Thread mdsmoker
I'm using django 1.1, python 2.5, and windows and i'm brand-spanking new to this. i installed django w/out a problem. python is in my windows path and if i type import django after running python i don't get any errors so I'm assuming it is installed correctly. after i run django-admin.py

Re: Django newbie deployment question

2009-08-01 Thread prabhu S
Your apache server would run as www user. Where as you have saved your project in /root with root as the owner. To do this properly, do not save your django project in /root. Have it somewhere like /var/www and make "www" as the owner. Also fix execute permissions. chmod -R 700 should do. Or

Django newbie deployment question

2009-08-01 Thread Ankur Gupta
Hello folks, I have facing the same problem mentioned in the stackoverflow question here ( http://stackoverflow.com/questions/962533/django-modpython-error-importerror-could-not-import-settings ). The solution doesn't seem to work Problem description The app runs fine using django internal

Re: newbie questions: common components in django

2009-07-19 Thread Gabriel Gunderson
On Sat, Jul 18, 2009 at 7:08 PM, online wrote: > I know i can have common stuff like this in django > > > > {% include "header.html" %} > > > blah > > > {% include "footer.html" %} > > > but it seems i need to pass data footer.html and header.html every > time i

Re: newbie questions: common components in django

2009-07-18 Thread Alex Gaynor
On Sat, Jul 18, 2009 at 8:08 PM, online wrote: > > Hi all, > > I know i can have common stuff like this in django > > > > {% include "header.html" %} > > > blah > > > {% include "footer.html" %} > > > but it seems i need to pass data footer.html and header.html

newbie questions: common components in django

2009-07-18 Thread online
Hi all, I know i can have common stuff like this in django {% include "header.html" %} blah {% include "footer.html" %} but it seems i need to pass data footer.html and header.html every time i include these pages? Thanks --~--~-~--~~~---~--~~ You

Re: newbie question information about js

2009-07-15 Thread Daniel Roseman
On Jul 15, 9:14 am, luca72 wrote: > Hello and thanks for your help. > I think that i need context, i attach my test file: > > from django.shortcuts import render_to_response > from off_bert.offerte.forms import RichiestaForm > from django.http import HttpResponseRedirect > >

Re: newbie question information about js

2009-07-15 Thread luca72
Hello and thanks for your help. I think that i need context, i attach my test file: from django.shortcuts import render_to_response from off_bert.offerte.forms import RichiestaForm from django.http import HttpResponseRedirect def richiesta(request): if request.method == 'POST': form

Re: newbie question information about js

2009-07-14 Thread Shawn Milochik
On Jul 14, 2009, at 12:30 PM, luca72 wrote: > > Hello > I have a question in my view fiole i have this > > def myfunct() > do this... > now i need only to return a js alert message on the same page > is it possible? We need more information. Are you calling

newbie question information about js

2009-07-14 Thread luca72
Hello I have a question in my view fiole i have this def myfunct() do this... now i need only to return a js alert message on the same page is it possible? --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Re: Complex form for a newbie with ImageField and ForeignField

2009-07-14 Thread djangonoob
thanks dude! that worked out perfectly for me. On Jul 14, 8:48 pm, Lakshman Prasad wrote: > You could replace in the view: > > if form_upload.is_valid(): >   form_upload.save() > > # with this: > > if form_upload.is_valid(): >   form_upload.user = request.user >  

Re: Complex form for a newbie with ImageField and ForeignField

2009-07-14 Thread Lakshman Prasad
You could replace in the view: if form_upload.is_valid(): form_upload.save() # with this: if form_upload.is_valid(): form_upload.user = request.user form_upload.save() You may also want to not display the user field in the form. You can do it by defining an 'exclude' Meta class

Complex form for a newbie with ImageField and ForeignField

2009-07-14 Thread djangonoob
I'm using django 1.02, Ubuntu 9.04, python 2.6.2 Issue: I am creating a simple application that allows users to upload images. I'm using the User from django.contrib.auth.models to manage my users. For the image class, i have a ForeignKey to the user and a ImageField to store my images My

Re: Newbie problem: AttributeError with ModelForm

2009-07-06 Thread Geoff
Thanks Daniel that was the answer. As someone from a database background I like the way Django can do so much from it's models with little coding. Regards Geoff --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: nested category listing [newbie]

2009-07-04 Thread C. Feldmann
solved it by loading the subcategories as a part of the category model. Thanks and have a great 4th of July weekend! > ... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

nested category listing [newbie]

2009-07-04 Thread C. Feldmann
Hello, this is probably a total newbie question, but I am really stumped on how to do this best. Coming from a PHP background I tried to loop through all categories and make a nested list. I kept on getting errors. Since django is so powerful there had to be a way to do this in the model

Re: Newbie problem: AttributeError with ModelForm

2009-07-03 Thread Daniel Roseman
On Jul 3, 8:38 am, Geoff wrote: > Dear Django users, > > I am writing my first Django application (also new to Python and have > not done any web programming for many years) and am trying to produce > a screen which allows a row to be added to a table (I know this can be

Newbie problem: AttributeError with ModelForm

2009-07-03 Thread Geoff
Dear Django users, I am writing my first Django application (also new to Python and have not done any web programming for many years) and am trying to produce a screen which allows a row to be added to a table (I know this can be done in admin but once I have it working I will add more

Re: Learning curve toward build reasonable webpage for a newbie

2009-07-02 Thread patrickk
is sounds like a silly > question, but I mean it. I think I feel comfortable to database access > kind of work, but I am always scared writing good css. > > Does Django help me (a developer) to avoid the CSS learning? > Basically, how Django may save newbie sometime about the UI de

Learning curve toward build reasonable webpage for a newbie

2009-07-02 Thread Developer_for_food
? Basically, how Django may save newbie sometime about the UI design (or does it at all)? I heard Django is a good framework, so I think it may offer such a benefit somehow? --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: Newbie question on ContentTypes and Generic Relations

2009-06-14 Thread Rana
Dear Daniel, Thanks so much for your help. I tried what you suggested and it works just as I need it to. Thank you again. Kind Regards, Rana On Jun 13, 3:01 am, Daniel Roseman wrote: > On Jun 12, 8:54 pm, Rana wrote: > > > > > Hi, > > > I am trying

Re: Newbie question on ContentTypes and Generic Relations

2009-06-13 Thread Daniel Roseman
On Jun 12, 8:54 pm, Rana wrote: > Hi, > > I am trying to modify a blog and article model that will both display > data from a related products model. I read that the way I should do > this is through the ContentTypes framework and generic foreign > relations. I would be

Newbie question on ContentTypes and Generic Relations

2009-06-12 Thread Rana
Hi, I am trying to modify a blog and article model that will both display data from a related products model. I read that the way I should do this is through the ContentTypes framework and generic foreign relations. I would be grateful for some guidance on how to do this. I've read the

Newbie question regarding django-authopenid

2009-06-08 Thread DrBloodmoney
For those who have used django-authopenid [1], can you tell me if it interferes with the built-in django user authentication system (users, permissions, groups, etc). I am going to attempt to get it running on a small project, but I won't bother if it interferes with auth. Thank you in advance

Re: Newbie - record parent ID in child data entered by ModelForm

2009-06-05 Thread adelaide_mike
Thank you TiNo that works if altered slightly like so: if form.is_valid(): instance = form.save(commit=False) instance.street_id= request.session['street_id'] instance.save() I have been using Django for about ten days, and it requires very

Re: Newbie - record parent ID in child data entered by ModelForm

2009-06-05 Thread TiNo
On Fri, Jun 5, 2009 at 11:04, adelaide_mike wrote: > Exception Value: 'PropertyForm' object does not support item > assignment > There you go. You can't do: > form['street']=request.session['street_id'] You can save the form instance first, without commiting,

Re: Newbie - record parent ID in child data entered by ModelForm

2009-06-05 Thread adelaide_mike
Thanks for the offer. I have altered the function as suggested: def property_data(request, property_id='0'): message = '' st = request.session['street_id'] print "At start of property_data, request.method=", request.method print "At start of property_data, st=",

Re: Newbie - record parent ID in child data entered by ModelForm

2009-06-05 Thread Daniel Roseman
On Jun 5, 5:33 am, adelaide_mike wrote: > Another "in principle" question.  My Street model is the parent of my > Property model, many to one via foreign key. > > User selects the street and I store it in request.session. User then > gets to enter the property

Newbie - record parent ID in child data entered by ModelForm

2009-06-04 Thread adelaide_mike
Another "in principle" question. My Street model is the parent of my Property model, many to one via foreign key. User selects the street and I store it in request.session. User then gets to enter the property details in this form: class PropertyForm(ModelForm): class Meta:

Re: Newbie pls help with stored values

2009-06-03 Thread adelaide_mike
zard/ > I guess > > On Jun 3, 8:04 am, adelaide_mike <mike.ro...@internode.on.net> wrote: > > > I am a newbie with Django and web stuff, but have long experience with > > desktop databases. > > > In Django my user runs through a series of template.htmls choosing a

Re: Newbie pls help with stored values

2009-06-03 Thread V
I'm not sure that I understood your problem, but form wizards might be what you are looking for http://docs.djangoproject.com/en/dev/ref/contrib/formtools/form-wizard/ I guess On Jun 3, 8:04 am, adelaide_mike <mike.ro...@internode.on.net> wrote: > I am a newbie with Django and

Newbie pls help with stored values

2009-06-03 Thread adelaide_mike
I am a newbie with Django and web stuff, but have long experience with desktop databases. In Django my user runs through a series of template.htmls choosing a particular great great grandchild object, a house. Then she must select a sales agent object. Just in general, how do I arrange

Re: Newbie Django 1.0 help with create object, uopdate object

2009-06-01 Thread adelaide_mike
uot;if request is a POST" check, so that if the form.is_valid() check fails, >   # we go back and show the HTML again with the form containing errors. >   return render__to_response('contests/edit_result.html', >                                 {'form': form}) > > Hope that helps! > > Ti

Re: Newbie Django 1.0 help with create object, uopdate object

2009-06-01 Thread Tim Sawyer
helps! Tim. On Monday 01 June 2009 15:56:24 adelaide_mike wrote: > Thanks for your response Tim. However, you lost me a bit there, I am > a real newbie. I have narrowed my question down to this: > > # in views.py: > > class PropertyForm(ModelForm): > class Meta: >

Re: Newbie Django 1.0 help with create object, uopdate object

2009-06-01 Thread adelaide_mike
Thanks for your response Tim. However, you lost me a bit there, I am a real newbie. I have narrowed my question down to this: # in views.py: class PropertyForm(ModelForm): class Meta: model = Property def property_update(request, property_id='0', street_id='0

Re: Newbie Django 1.0 help with create object, uopdate object

2009-06-01 Thread Tim Sawyer
On Monday 01 June 2009 01:38:30 adelaide_mike wrote: > I found a really clear explanation of creating and updating database > objects in SAMS TeachYourself Django, but it appears to be for v > 0.96. > > I have looked at "Creating forms from models" in the documentation, > and about one-third the

Newbie Django 1.0 help with create object, uopdate object

2009-05-31 Thread adelaide_mike
I found a really clear explanation of creating and updating database objects in SAMS TeachYourself Django, but it appears to be for v 0.96. I have looked at "Creating forms from models" in the documentation, and about one-third the way down it shows the following: # Create a form instance from

Re: Newbie, hierarchical models, url.py problem

2009-05-30 Thread adelaide_mike
Thanks Gabriel. I think it would be good if the tutorial included a three-level hierarchy sowing how to handle the url.py and views.py for the third layer. Anyway, I now understandone step more. Thanks and regards On May 31, 11:46 am, Gabriel wrote: > adelaide_mike

Re: Newbie, hierarchical models, url.py problem

2009-05-30 Thread Gabriel
adelaide_mike escribió: > urlpatterns = patterns('whasite.wha.views', > > (r'^address/{{street.id}}/(?P\d+)/$', 'select_event'), > (r'^address/(?P\d+)/$', 'select_property'), > (r'^address/$', 'select_street'), > (r'^$', 'address'), > ) (r'^address/(?P\d+)/(?P\d+)/$',

Newbie, hierarchical models, url.py problem

2009-05-30 Thread adelaide_mike
I have model classes Suburb, Street ,Property and Event. Each has a name , a foreign key to the model above, and the id provided by default. In the admin everything is fine. The template address.html has a search field and returns a startswith query that generates streets. Clicking a line in

Re: How to modify and object before saving it in ModelForm [was] Newbie needs help

2009-05-30 Thread Andy
Thanks Kenneth. I'll check out the link and use better subject lines in the future...unless you want to send a donation! On May 30, 1:38 am, Kenneth Gonsalves wrote: > On Saturday 30 May 2009 12:47:27 Andy wrote: > > > I would like to set the order_number in my model to

Re: How to modify and object before saving it in ModelForm [was] Newbie needs help

2009-05-30 Thread Kenneth Gonsalves
On Saturday 30 May 2009 12:47:27 Andy wrote: > I would like to set the order_number in my model to be equal to the > automatically assigned ID plus 10,000.  Can anybody tell me how to > achieve this? check out commit=False in this document:

Newbie needs help

2009-05-30 Thread Andy
Hello, I am new to Django and Python but am determined to learn. I am creating a page that asks for some user input. My model looks like this: from django.db import models from django.forms import ModelForm floor_plan_choices = ( ('A', 'Square'), ('B', 'Rectangular'),

Re: Quick newbie question

2009-05-26 Thread Itai
Ok sorry about that weird question - I figured it out now. Thanks Kenneth! On May 27, 6:54 am, Kenneth Gonsalves wrote: > On Wednesday 27 May 2009 04:22:12 Itai wrote: > > > As I was working my way through the tutorial (part 3), I ran into a > > little problem. > > >

Re: Quick newbie question

2009-05-26 Thread Kenneth Gonsalves
On Wednesday 27 May 2009 04:22:12 Itai wrote: > As I was working my way through the tutorial (part 3), I ran into a > little problem. > > When creating the HTML file with style descriptions (, ..), > the page doesn't render the styles but rather the actual code, i.e: > What's up? > > > >

Quick newbie question

2009-05-26 Thread Itai
Hey, As I was working my way through the tutorial (part 3), I ran into a little problem. When creating the HTML file with style descriptions (, ..), the page doesn't render the styles but rather the actual code, i.e: What's up? instead of: What's up? (in the correct style) What am I doing

Re: How to handle view/url situation (Newbie)

2009-05-04 Thread Masklinn
On 4 mai 09, at 23:36, Malcolm Tredinnick wrote: > On Mon, 2009-05-04 at 15:41 +0200, Masklinn wrote: >> On 4 May 2009, at 14:55 , pbzRPA wrote: >>> On May 4, 1:24 pm, Masklinn wrote: > > [...] > FWIW the `'app.views.showItems'` isn't even

Re: How to handle view/url situation (Newbie)

2009-05-04 Thread Masklinn
On 4 mai 09, at 23:36, Malcolm Tredinnick wrote: > On Mon, 2009-05-04 at 15:41 +0200, Masklinn wrote: >> On 4 May 2009, at 14:55 , pbzRPA wrote: >>> On May 4, 1:24 pm, Masklinn wrote: > > [...] > FWIW the `'app.views.showItems'` isn't even

Re: How to handle view/url situation (Newbie)

2009-05-04 Thread Malcolm Tredinnick
On Mon, 2009-05-04 at 15:41 +0200, Masklinn wrote: > On 4 May 2009, at 14:55 , pbzRPA wrote: > > On May 4, 1:24 pm, Masklinn wrote: [...] > >> FWIW the `'app.views.showItems'` isn't even necessary, you can just > >> pass the view function and reverse will figure out the

Re: How to handle view/url situation (Newbie)

2009-05-04 Thread scott212
I'm not saying that the original OP code didn't work, just that it felt sloppy to have this lists/delete/item1 url lingering out there. Just looking for a better way. :) John Crawford-14 wrote: > > > Okay, I'm not sure why the OP code didn't work - it seems like going > to the URL

Re: How to handle view/url situation (Newbie)

2009-05-04 Thread John Crawford
Okay, I'm not sure why the OP code didn't work - it seems like going to the URL 'lists/show', with the updated list, would work. So my *guess* is that since it's a page the browser already saw and cached, that the page just isn't getting refreshed. In other words, if he hit the browser-refresh

Re: How to handle view/url situation (Newbie)

2009-05-04 Thread scott212
You guys are awesome, it's always great to find a great new framework and then find out it has a great community as well. I can't wait to try this tonight. Thanks again! Masklinn wrote: > > > On 4 May 2009, at 14:55 , pbzRPA wrote: >> On May 4, 1:24 pm, Masklinn

Re: How to handle view/url situation (Newbie)

2009-05-04 Thread Masklinn
On 4 May 2009, at 14:55 , pbzRPA wrote: > On May 4, 1:24 pm, Masklinn wrote: >> On 4 May 2009, at 12:47 , pbzRPA wrote: >> >>> I would do the following. >> >>> from django.http import HttpResponseRedirect >>> from django.core.urlresolvers import reverse >> >>> def

Re: How to handle view/url situation (Newbie)

2009-05-04 Thread pbzRPA
On May 4, 1:24 pm, Masklinn wrote: > On 4 May 2009, at 12:47 , pbzRPA wrote: > > > I would do the following. > > > from django.http import HttpResponseRedirect > > from django.core.urlresolvers import reverse > > > def deleteItems(request, item): > > >    return

Re: How to handle view/url situation (Newbie)

2009-05-04 Thread Masklinn
On 4 May 2009, at 12:47 , pbzRPA wrote: > I would do the following. > > from django.http import HttpResponseRedirect > from django.core.urlresolvers import reverse > > def deleteItems(request, item): > >return HttpResponseRedirect(reverse('app.views.showItems')) FWIW the

Re: How to handle view/url situation (Newbie)

2009-05-04 Thread pbzRPA
I would do the following. from django.http import HttpResponseRedirect from django.core.urlresolvers import reverse def deleteItems(request, item): return HttpResponseRedirect(reverse('app.views.showItems')) --~--~-~--~~~---~--~~ You received this message

Re: How to handle view/url situation (Newbie)

2009-05-04 Thread Masklinn
On 4 mai 09, at 06:54, scott212 wrote: > I'm reading through the djangobook and trying to build a small app as > I go. The app is just a list that I can add to and delete entries > from. Deleting is easy, but I'm not sure how the url/view portion > should be handled. > >

Re: How to handle view/url situation (Newbie)

2009-05-03 Thread George Song
On 5/3/2009 9:54 PM, scott212 wrote: > I'm reading through the djangobook and trying to build a small app as > I go. The app is just a list that I can add to and delete entries > from. Deleting is easy, but I'm not sure how the url/view portion > should be handled. > >

How to handle view/url situation (Newbie)

2009-05-03 Thread scott212
I'm reading through the djangobook and trying to build a small app as I go. The app is just a list that I can add to and delete entries from. Deleting is easy, but I'm not sure how the url/view portion should be handled. http://127.0.0.1:8080/lists/show/ list item 1 - [delete] list item 2 -

Re: Newbie Tutorial Question Part 4

2009-05-01 Thread arfinsd
Got it, shouldn't be hitting /polls Since we put in the object_id Alex On May 1, 8:57 am, arfinsd <alex.r.fergu...@gmail.com> wrote: > Have a newbie question. I'm stuck on the tutorial and keep getting a > 404 error when I try to hit:http://127.0.0.1:8000/polls > > My file

Newbie Tutorial Question Part 4

2009-05-01 Thread arfinsd
Have a newbie question. I'm stuck on the tutorial and keep getting a 404 error when I try to hit: http://127.0.0.1:8000/polls My files are listed below, does anyone see something that I'm doing wrong? URLS.py #-- # Uncomment the next two lines to enable

[Newbie]Help with templates

2009-04-26 Thread Prtamma
from django.db import models from django.utils.translation import ugettext_lazy as _ from django.conf import settings from django.db.models import permalink from django.contrib.auth.models import User import datetime class PersonType(models.Model): title = models.CharField(max_length=100)

[Newbie]List Mapping in Template?

2009-04-26 Thread andrew
We know that power MTV of Django. Here is my question. I have 3 list of "Thing", fruit,bread,wine, but they share a same structure of template,I want to render them to on template like this: view: fruitList = thing.objects.filter(type='1') breadList = thing.objects.filter(type='2') wineList =

Re: newbie: syncdb doesnt update schema after model change?

2009-04-17 Thread JL
What you're trying to do is called "Schema migration" or "evolution" there's been a lot of talk of it in the past. I recommend the South project for evolution. Very very flexible. Check it out here: http://south.aeracode.org/ On Apr 17, 1:30 am, Rama Vadakattu

Re: newbie: syncdb doesnt update schema after model change?

2009-04-17 Thread Rama Vadakattu
OR you can use django-evolutions which evolves the database schema in sync with the models. More details at : http://code.google.com/p/django-evolution/ On Apr 17, 10:29 am, zayatzz wrote: > If the tables of this app hold no info, then you can do python > manage.py

Re: newbie: syncdb doesnt update schema after model change?

2009-04-16 Thread zayatzz
If the tables of this app hold no info, then you can do python manage.py reset appname. This clears all tables of this app but the changes will hit database :) Alan On Apr 16, 7:11 pm, Aneesh wrote: > This is by design.  syncdb only checks to see if it needs to

Re: newbie: syncdb doesnt update schema after model change?

2009-04-16 Thread Brian Neal
On Apr 16, 11:00 am, gry wrote: > [django: 1.1 beta 1 SVN-10407, python 2.5.2, ubuntu] > My first django toy app.  I've been working through the > tutorialhttp://docs.djangoproject.com/en/dev/intro/tutorial02/. > I've already done a few cycles of  (change-model,

Re: newbie: syncdb doesnt update schema after model change?

2009-04-16 Thread Aneesh
This is by design. syncdb only checks to see if it needs to create any new DB tables for any models; it does NOT alter existing model tables. See http://docs.djangoproject.com/en/dev/ref/django-admin/#syncdb for more info. If you don't have any valuable data in the table (ie, you're just

newbie: syncdb doesnt update schema after model change?

2009-04-16 Thread gry
[django: 1.1 beta 1 SVN-10407, python 2.5.2, ubuntu] My first django toy app. I've been working through the tutorial http://docs.djangoproject.com/en/dev/intro/tutorial02/. I've already done a few cycles of (change-model, ./manage.py syncdb) with success. I just added email and birthday fields

<    4   5   6   7   8   9   10   11   12   13   >