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

2009-05-03 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. > > http://127.0.0.1:8080/lis

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. > > http://127.0.0.1:8080/lists

Re: Os.path in window and linux help?

2009-05-03 Thread George Song
On 5/3/2009 9:36 PM, phan sarak wrote: > this is the def in my view.py > > # > return ouputting_pdf('reports/employee_report_pdf.html',{ > 'pagesize':'A4', > 'curr_employee':get_employee, >

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 - [del

Re: Template tags and variables overlapping

2009-05-03 Thread Steve Howell
On May 3, 1:15 pm, Julián C. Pérez wrote: > > example: > {% createLink "a link to something" src "class attr" "id attr" "title > attri" %} > would output something like: > a > link to something > > how can i make the 'src' input to be the result of url tag calling a > valid view?? I recommend t

Os.path in window and linux help?

2009-05-03 Thread phan sarak
My structure project -- myprjetct -myapp -site_media -images -template -report -employee_report_pdf.html this is the def in my view.py # retur

Re: ManyToMany with a "through" attribute in the admin profile

2009-05-03 Thread George Song
On 5/3/2009 8:17 PM, nbv4 wrote: > On May 3, 3:51 pm, Ramiro Morales wrote: >> On Sun, May 3, 2009 at 4:26 PM, nbv4 wrote: >> >>> Everything is fine and dandy, except for when I want to use the admin >>> interface to create a new route. All I see is a dropdown for the >>> "often" field. I have t

Re: problem rendering html images in browser

2009-05-03 Thread George Song
On 5/3/2009 7:22 PM, Mac wrote: > I've had trouble rendering images in my browser. I just get a broken > link. Any thoughts on how to fix this? I'm working with the > development server, and I've check my code carefully to insure the src=path/> to the image file is correct. If I open the html tem

Re: url template tag help

2009-05-03 Thread Julián C . Pérez
hi everyone... i just took the easiest option i had i rewrite my urls.py file completely again and by now... it works! weird, i know... i'm just appending the former urlpatterns lines i had, one by one, testing every single of them one by one... and working thank u all so much! ;) On May 3, 10:37

Re: url template tag help

2009-05-03 Thread Margie
Yup, I agree with you Kevin. The django framework is very powerful. I started out with no webapp experience, and have also been able to build a very nice web app using django. It took me considerably longer than a week to come up to speed, but I had zero background in html, css, sql, or web apps

Re: ManyToMany with a "through" attribute in the admin profile

2009-05-03 Thread nbv4
On May 3, 3:51 pm, Ramiro Morales wrote: > On Sun, May 3, 2009 at 4:26 PM, nbv4 wrote: > > > Everything is fine and dandy, except for when I want to use the admin > > interface to create a new route. All I see is a dropdown for the > > "often" field. I have to go to the RouteBase section of the

problem rendering html images in browser

2009-05-03 Thread Mac
I've had trouble rendering images in my browser. I just get a broken link. Any thoughts on how to fix this? I'm working with the development server, and I've check my code carefully to insure the to the image file is correct. If I open the html template file with my browser, it does render the im

Re: Adding extra text to admin?

2009-05-03 Thread Lee Hinde
On Sun, May 3, 2009 at 6:43 PM, Lee Hinde wrote: > On Sun, May 3, 2009 at 6:26 PM, ringemup wrote: >> >> Other than hardcoding the text into template files, is there any way >> to add extra text (e.g. instructions) to the admin area?  It doesn't >> have to show up in the default admin templates,

Re: Adding extra text to admin?

2009-05-03 Thread Lee Hinde
On Sun, May 3, 2009 at 6:26 PM, ringemup wrote: > > Other than hardcoding the text into template files, is there any way > to add extra text (e.g. instructions) to the admin area?  It doesn't > have to show up in the default admin templates, just be passed as > context to my custom templates.  An

Adding extra text to admin?

2009-05-03 Thread ringemup
Other than hardcoding the text into template files, is there any way to add extra text (e.g. instructions) to the admin area? It doesn't have to show up in the default admin templates, just be passed as context to my custom templates. Any suggestions? Thanks! --~--~-~--~~---

Re: Template tags and variables overlapping

2009-05-03 Thread Julián C . Pérez
okss thank u all for your replies i have a new question about it... in order to make more portable my code, i like to create warepper functions to anything... i want to make a function -in this case a template tag- for creation of links... example: {% createLink "a link to something" src "class

Re: ManyToMany with a "through" attribute in the admin profile

2009-05-03 Thread Ramiro Morales
On Sun, May 3, 2009 at 4:26 PM, nbv4 wrote: > > Everything is fine and dandy, except for when I want to use the admin > interface to create a new route. All I see is a dropdown for the > "often" field. I have to go to the RouteBase section of the admin to > add the rest. Normally if there is a Ma

ManyToMany with a "through" attribute in the admin profile

2009-05-03 Thread nbv4
I have a few models that looks like this: - class Route(models.Model): points = models.ManyToManyField(Base, through="RouteBase") often = models.IntegerField(choices=ROUTE_OFTEN, default=0) class RouteBase(models.Model): point = models.ForeignKey("Base") route = models.Forei

Re: Split models.py to smaller parts.

2009-05-03 Thread Malcolm Tredinnick
On Sun, 2009-05-03 at 10:01 -0700, Rick Wagner wrote: > > > Thank you for the explanation. I think this trick is not in the > > > Documentation yet > > > > That's because it's pretty basic Python knowledge. I'm sure I've read > > on this list that basic Python knowledge isn't supposed to be >

Re: Split models.py to smaller parts.

2009-05-03 Thread Rick Wagner
> > Thank you for the explanation. I think this trick is not in the > > Documentation yet > > That's because it's pretty basic Python knowledge. I'm sure I've read   > on this list that basic Python knowledge isn't supposed to be   > documented in Django as it's already part of the official Python

Re: How do I set a foreign key as a primary key?

2009-05-03 Thread Malcolm Tredinnick
On Sun, 2009-05-03 at 09:03 -0700, Thierry wrote: > I have the following model: > > class Person(models.Model): > person = models.ForeignKey(User) > age = models.IntegerField() > > How can I set the above foreign key to be my primary key so that my > Person table only contains two column

How do I set a foreign key as a primary key?

2009-05-03 Thread Thierry
I have the following model: class Person(models.Model): person = models.ForeignKey(User) age = models.IntegerField() How can I set the above foreign key to be my primary key so that my Person table only contains two columns (person, age)? --~--~-~--~~~---~--~-

Re: models.py general help

2009-05-03 Thread Michael
On Sun, May 3, 2009 at 9:15 AM, Sanket Agarwal wrote: > > > class Files(models.Model): > >"""Uploads area, all files to be ready for user use are put here""" > > >filepath = models.FilePathField(_('Choose File'),path="/home/sanket/ > Music") >filedescription = models.Cha

Re: Altering database object

2009-05-03 Thread Vedlen
Thank you very much guys. I used George's way to get it working. Thanks again Vedlen On May 3, 12:32 pm, Daniel Roseman wrote: > On May 3, 2:24 am, Vedlen wrote: > > > > > I've got multiple tuples, and I need all the fields. > > I just need to pass all the "moment" fields from the tuples, in

models.py general help

2009-05-03 Thread Sanket Agarwal
Hey, I am trying to do something very simple I have a downloads app in my django project. It has some fields like file name, file path, file type and file size. What I wish is to take the file path and get the file size via maybe getsize function in os, but how can I write equivalent code for

Re: Split models.py to smaller parts.

2009-05-03 Thread Masklinn
On 3 May 2009, at 13:54 , johan.uhIe wrote: > Thank you for the explanation. I think this trick is not in the > Documentation yet That's because it's pretty basic Python knowledge. I'm sure I've read on this list that basic Python knowledge isn't supposed to be documented in Django as it's al

Re: Split models.py to smaller parts.

2009-05-03 Thread johan.uhIe
Thank you for the explanation. I think this trick is not in the Documentation yet, I've opened a ticket for it ... http://code.djangoproject.com/ticket/10985 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django use

Re: Altering database object

2009-05-03 Thread Daniel Roseman
On May 3, 2:24 am, Vedlen wrote: > I've got multiple tuples, and I need all the fields. > I just need to pass all the "moment" fields from the tuples, into my > function. > > Here is what my template looks like : > > > {{ for s in Score }} > {{ s.moment }}{{ s.someOtherField }} > {{ endfor }} >

Re: Retrieving data from a form ChoiceField

2009-05-03 Thread Daniel Roseman
On May 3, 11:01 am, Alex Rades wrote: > Hi, > i have a simple form which among other fields has a ChoiceField with > some choices: > > CHOICES=( >   (1, u'Bar basf asdf'), >   (2, u'Asdf', qewr'), >   (3, u'Afefafafa saef3') > ) > > when i receive the form, i do all the usual procedure until i wa

Retrieving data from a form ChoiceField

2009-05-03 Thread Alex Rades
Hi, i have a simple form which among other fields has a ChoiceField with some choices: CHOICES=( (1, u'Bar basf asdf'), (2, u'Asdf', qewr'), (3, u'Afefafafa saef3') ) when i receive the form, i do all the usual procedure until i want to retrieve the value of the choicefield (have to produc

Re: A way to specify different template code for every 6th item in a list?

2009-05-03 Thread Elliott
If it's as simple as a color change or bold or something, you can use {% cycle "red" "red" "red" "red" "red" "blue" %} On May 2, 3:14 am, Daniel Roseman wrote: > On May 2, 7:28 am, "Chris O'Donnell" wrote: > > > I'm using the Blueprint CSS framework and need to be able to have > > every 6th lis

Re: Easy display of table of data without a backing model

2009-05-03 Thread Richard Davies
P.S. An obvious hack would be to save all my data from memory into a Django model, then do the view based on the model. I'd like to avoid that if at all possible, both because it's ugly to save data into the database just to pass it to a view and also because I'd then get into all kinds of issues

Easy display of table of data without a backing model

2009-05-03 Thread Richard Davies
Hi! I'd appreciate any advice / pointers on how the following can be done easily... I'm writing some web pages which display a large table of static data - a large number of rows, each with the same columns. Ideally the pages would look very much like the Django admin pages which show all instan

Re: Avatars in comments

2009-05-03 Thread Andy Mikhailenko
The easiest way is probably to use something like django-gravatar[1]. Not only you can avoid writing extra models/views, but your site will also reuse existing avatars for some users because Gravatar utilizes email as use ID. So you'll only have to add one tag to your template: {% for comment in

ManyToMany relationships in an object creation view

2009-05-03 Thread notcourage
I'm interested in hearing how you cope w/ the problem of specifying ManyToMany relationships in an object creation view. Consider two models M1 & M2 and a creation view/form for M1. A technique I'm using is to specify M2 values as an unbound field in a ModelForm for M1. When the form validates: m1

Checking Django messages in windows

2009-05-03 Thread Croydon
I used Django in linux for my uni project, so Im fairly comfortable with it. Now im trying to create a facebook app on windows. I installed XAMPP and all the other requirements and the test app is working fine. The problem is checking the django messages, that show up when your server is running

Re: django setting problem on windows

2009-05-03 Thread Croydon
I just installed Djang/XAMPP on windows using this guide http://jyotirmaya.blogspot.com/2008/11/xampp-python-django.html --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, s