Re: How to order alphabetically

2007-01-21 Thread conrad22
All working as I wanted! Many thanks for everyone's help! --~--~-~--~~~---~--~~ 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

Re: How to order alphabetically

2007-01-18 Thread conrad22
Deryck, I thought it ought to be along those lines, but I can't seem to get it working. I'm trying to use: org_name = models.CharField ('Organisation', maxlength = 200) class Meta: ordering = 'org_name', But still sorts chronologically...? --~--~-~--~~~---

How to order alphabetically

2007-01-18 Thread conrad22
I might be missing something in the documentation here, but is there an obvious/easy way to call a list of objects alphabetically? All that 'ordering' does in a Meta class on a model is order chronologically, no? with thanks --~--~-~--~~~---~--~~ You received thi

Re: How to create a simple PDF

2007-01-17 Thread conrad22
Ok, thanks everyone...I am looking at all of the suggestions above, but it does look like Chris's solution is a good one - being able to separate the Django logic that you already have, from the templates, and from the PDF generation has got through to even my limited understanding. A million th

How to create a simple PDF

2007-01-15 Thread conrad22
Please could anyone give me a quick how to on PDF outputting. I've looked at the official documentation around Report Lab, but remain clueless. If you have a simple model: eg a list of contacts, how do you 'draw' the PDF? With thanks in advance --~--~-~--~~~---~--~--

Re: Help with get absolute url

2006-12-14 Thread conrad22
You were quite right, Wayne, there was a mistake in my model (Charfield instead of SlugField)...so don't I feel stupid! A million thanks to everyone anyway! (I feel quite well qualified to write an idiot's guide now...) --~--~-~--~~~---~--~~ You received this me

Re: Help with get absolute url

2006-12-14 Thread conrad22
In other words, why can't I simply put {{organisation.get_absolute_url}} to return the organisation's detail page? Surely the whole point of the get_absolute_url is to be able to call an object from wherever? So what would I put in the model and/or urls.py to be able to do this? At the moment I

Re: Help with get absolute url

2006-12-13 Thread conrad22
Mmm...I actually got it to work in the category_detail template: {% for organisation in object.organisation_set.all %} {{organisation.org_name}} {% endfor %} Each category does return a list of the organisations that are in it, but what I need to do is then simply provide access to

Re: Help with get absolute url

2006-12-13 Thread conrad22
Yes, I know. Sorry, should have been more specific: the problem is, that the second part of the url pattern comes from a different model. I've tried (r'^categories/(?P\d+)/(?P\w+)/$','django.views.generic.list_detail.object_detail', info_dict), but it's obviously not quite there...? How would I

Re: Help with get absolute url

2006-12-12 Thread conrad22
Woops..see, I am already mad, as I have not communicated the actual problem.. The last bit - 'categories/1/k/' returns a page/url not found error, as follows: Request Method: GET Request URL:http://127.0.0.1:8000/categories/1/k/ Using the URLconf defined in kvn.urls, Django tri

Help with get absolute url

2006-12-12 Thread conrad22
Hi Hopefully someone can step in here before I go totally mad... I am trying to define the absolute_url and/or the urls.py file to arrive at the following: A list of categories, which leads to a list of organisations in each category. I want then each organisation in the list to go to its generi

Re: M2M - 'backward' relationship

2006-12-09 Thread conrad22
It's ok. I've found the answer in another post from tonight (on 'combining' generic views). http://groups.google.com/group/django-users/browse_thread/thread/609a869092acf42c/e7690f2b19812003?#e7690f2b19812003 --~--~-~--~~~---~--~~ You received this message beca

M2M - 'backward' relationship

2006-12-09 Thread conrad22
In the API documentation it says: Many-to-many relationships "Both ends of a many-to-many relationship get automatic API access to the other end. The API works just as a "backward" one-to-many relationship. The only difference is in the attribute naming: The model that defines the ManyToManyField

Re: ManyRelatedManager object in templates

2006-11-29 Thread conrad22
ie what is the simplest way to call the categories that have been selected for each organisation ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-u

Re: ManyRelatedManager object in templates

2006-11-29 Thread conrad22
Ah ha! I've had a thought..could I use a custom Manager to predefine the query and then call in the template? In which case, how would a write a query set for the manager that only returns those categories that an organisation has selected? --~--~-~--~~~---~--~~

View on Site link from Admin

2006-11-28 Thread conrad22
How do I get the 'View on site' link that appears in the Django interface to work? I've tried adding the following to my urls.py (r'^r/', include('django.conf.urls.shortcut')), But didn't do anything! Thanks! --~--~-~--~~~---~--~~ You received this message

ManyRelatedManager object in templates

2006-11-28 Thread conrad22
Hi I have two models, A and B, with B having an M2M relationship to A. What is the best way to access/list the 'joined' data in a Django template? Would it be best to define the potential joint data in the _str_ as well? eg. I have the following error appearing, instead of the object: django.db.

Re: 'NoneType' object has no attribute 'get_field_sets'

2006-11-28 Thread conrad22
Many thanks Ramiro. I did as you suggested, and all was fine. I think that it is easy to forget the purpose of the Django admin site, as it is so polished! (ie the purpose, in this case, would be to be able to edit the Categories. Thanks again! --~--~-~--~~~---~--~---