Re: Having trouble with views

2006-08-11 Thread Jorge Gajon
Many people come to Django without having knowledge of Python before, and that's perfectly fine!, but you must be aware that it is DOUBLE hard, and you must double your efforts to learn Django and Python alongside. My recommendation (and Malcolm also said it) is that you first get to know Python

Re: Having trouble with views

2006-08-11 Thread Tomas Jacobsen
Malcolm Tredinnick wrote: > On Fri, 2006-08-11 at 05:59 -0700, Tomas Jacobsen wrote: > > > Is there an easy way to just drop the 'category_slug' the detail_view, > > > or is it another/better way to do this? > > > > I missed a 'in' there:" just drop the 'category_slug' in* the > > detail_view " >

Re: Having trouble with views

2006-08-11 Thread Malcolm Tredinnick
On Fri, 2006-08-11 at 05:59 -0700, Tomas Jacobsen wrote: > > Is there an easy way to just drop the 'category_slug' the detail_view, > > or is it another/better way to do this? > > I missed a 'in' there:" just drop the 'category_slug' in* the > detail_view " > > Anyways, it seems like you got the

Re: Having trouble with views

2006-08-11 Thread Tomas Jacobsen
> Is there an easy way to just drop the 'category_slug' the detail_view, > or is it another/better way to do this? I missed a 'in' there:" just drop the 'category_slug' in* the detail_view " Anyways, it seems like you got the idea. Im trying to modify the view you wrote for me for the category

Re: Having trouble with views

2006-08-11 Thread Malcolm Tredinnick
On Fri, 2006-08-11 at 04:47 -0700, Tomas Jacobsen wrote: > Yes, I was missing the last slash. Now I get the detail page, but now I > get the real problem I thought I had at first for this page. Because I > use the category_slug in my url for the detail page, I don't think I > can use generic view

Re: Having trouble with views

2006-08-11 Thread Tomas Jacobsen
Yes, I was missing the last slash. Now I get the detail page, but now I get the real problem I thought I had at first for this page. Because I use the category_slug in my url for the detail page, I don't think I can use generic view for this page? Don't I need a "custom" view that get the 'catego

Re: Having trouble with views

2006-08-11 Thread Malcolm Tredinnick
On Fri, 2006-08-11 at 02:42 -0700, Tomas Jacobsen wrote: > > Malcolm Tredinnick wrote: > > On Fri, 2006-08-11 at 02:12 -0700, Tomas Jacobsen wrote: > > > Malcolm Tredinnick wrote: > > > > > > The command line your talking about, is it the shell? > > > > Yes. > > > > > I've tried python manage.py

Re: Having trouble with views

2006-08-11 Thread Tomas Jacobsen
Malcolm Tredinnick wrote: > On Fri, 2006-08-11 at 02:12 -0700, Tomas Jacobsen wrote: > > Malcolm Tredinnick wrote: > > > > The command line your talking about, is it the shell? > > Yes. > > > I've tried python manage.py shell and the code you wrote. But nothing > > happends when I type them in. N

Re: Having trouble with views

2006-08-11 Thread Malcolm Tredinnick
On Fri, 2006-08-11 at 02:12 -0700, Tomas Jacobsen wrote: > Malcolm Tredinnick wrote: > > > Since the first part of the URL mapping tuple is a Python regular > > expression, you can experiment at the command line. Import the "re" > > module and use the regular expression you are trying to get work

Re: Having trouble with views

2006-08-11 Thread Tomas Jacobsen
Malcolm Tredinnick wrote: > Since the first part of the URL mapping tuple is a Python regular > expression, you can experiment at the command line. Import the "re" > module and use the regular expression you are trying to get working to > match against the sorts of URLs you are going to be sendin

Re: Having trouble with views

2006-08-10 Thread Malcolm Tredinnick
On Thu, 2006-08-10 at 13:24 -0700, Tomas Jacobsen wrote: > Hi. Im pulling my hair out trying to make this url. I have seem some [...] > > My urls looks like this now: > > > info_dict = { > 'queryset': Project.objects.all(), > } > > urlpatterns = patterns('', > > #Portfolio > (

Re: Having trouble with views

2006-08-10 Thread Tomas Jacobsen
Hi. Im pulling my hair out trying to make this url. I have seem some more source codes of other django projects, but I cant find anything like my problem. I've tried (r'^portfolio/(?P[-\w]+)/(?P[-\w]+)$', 'myproject.portfolio.views.category_view'), and (r'^portfolio/(?P[-\w]+)/(?P[-\w]+)$', '

Re: Having trouble with views

2006-08-02 Thread Tomas Jacobsen
Yes! That worked. Woho!! Thank you Malcolm and Martin! The next step is getting the detail view of each project to work. Do I need to write a new view for that, or can I use django generic view? My urls looks like this now: mydomain.com/portfolio = list all my projects mydomain.com/portfolio/c

Re: Having trouble with views

2006-08-01 Thread Martin Glueck
Hi, > NameError at /portfolio/3d/ > global name 'object_detail' is not defined > > Exception Location: /myproject/portfolio/views.py in category_view, > line 10 That normally mean that you have not imported the name. Do you have something like this in you views.py from django.views.generic

Re: Having trouble with views

2006-08-01 Thread Tomas Jacobsen
Yes, that seems to get me one step further! But now I get a new error: NameError at /portfolio/3d/ global name 'object_detail' is not defined Exception Location: /myproject/portfolio/views.py in category_view, line 10 --~--~-~--~~~---~--~~ You received this

Re: Having trouble with views

2006-08-01 Thread Martin Glueck
Hi, >[...]#Views > def category_view(request, cat_slug): > [...] > (r'^portfolio/(?P[-\w]+)/$', > 'myproject.portfolio.views.category_view'), > > When I try "mydomain.com/portfolio/category_slug" (My category_slug is > "3d") I get the error: > > TypeError at /portfolio/3d/ > category_view(

Re: Having trouble with views

2006-08-01 Thread Tomas Jacobsen
I have been on vaction for a week, so I haven't had time to do more coding before now. I think I understand what you have written in the view, but I can't understand what to write in urls.py. My views.py in my portfolio app folder looks like this: from django.views.generic.list_detail import obj

Re: Having trouble with views

2006-07-21 Thread Malcolm Tredinnick
On Fri, 2006-07-21 at 04:53 -0700, Tomas Jacobsen wrote: > I have done some more reading of other tutorials, and Im slowly getting > further. I now understand that I can use django generic views instead > of writing my own view. (sorry Malcolm, I diden't get that before). I > have now made one url

Re: Having trouble with views

2006-07-21 Thread Tomas Jacobsen
I have done some more reading of other tutorials, and Im slowly getting further. I now understand that I can use django generic views instead of writing my own view. (sorry Malcolm, I diden't get that before). I have now made one url pattern for my project listing. It's listing all of my project,

Re: Having trouble with views

2006-07-12 Thread Jorge Gajon
Hi again, > a ForeignKey to Category in your Project model, i.e. that a Project > belongs to a Category, like this: Ooopss, I left something out there. But any case I wanted to apologize for rushing with my previous email, I did not read the email that Malcolm sent before and he is raising very

Re: Having trouble with views

2006-07-12 Thread Jorge Gajon
Hi Tomas, I have not read the previous emails, so please excuse me if I'm misinterpreting something. I'll comment on what you said on the last email only. > I have tried with but > I think I need to write a new function inside views.py in my > "portfolio" app, that will bring out that category s

Re: Having trouble with views

2006-07-12 Thread Tomas Jacobsen
I will try to explain some more. I have managed to "render" project slug and project title into html. My template is inside "/django/django_templates/portfolio/" and is called "index.html". If I try to type in "mydomain.com/portfolio" I get the nice list of project name, and inside the "a href" I

Re: Having trouble with views

2006-07-12 Thread Malcolm Tredinnick
On Tue, 2006-07-11 at 15:30 -0700, Tomas Jacobsen wrote: > Wow, thanks for the help! I do understand the principle of views and > templates now, but I still need some help. > > I have managed to get out the slug name of my projects in > "mydomain/portfolio/". But I don't know how I write the view

Re: Having trouble with views

2006-07-11 Thread Tomas Jacobsen
Wow, thanks for the help! I do understand the principle of views and templates now, but I still need some help. I have managed to get out the slug name of my projects in "mydomain/portfolio/". But I don't know how I write the view for the detail page or how I get the right URL to the detail. I w

Re: Having trouble with views

2006-07-10 Thread Malcolm Tredinnick
On Mon, 2006-07-10 at 08:55 -0700, Tomas Jacobsen wrote: > Im trying to make a blog-like portfolio with finished projects I have > done. I want it to be easy to update when I have done something new, so > I thougth django seemed interesting for my webpage. I have been reading > some tutorials, and

Having trouble with views

2006-07-10 Thread Tomas Jacobsen
Im trying to make a blog-like portfolio with finished projects I have done. I want it to be easy to update when I have done something new, so I thougth django seemed interesting for my webpage. I have been reading some tutorials, and I finaly have manged to get in all the fields I want in the admi