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
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...?
--~--~-~--~~~---
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
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
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
--~--~-~--~~~---~--~--
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
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
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
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
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
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
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
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
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
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?
--~--~-~--~~~---~--~~
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
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.
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!
--~--~-~--~~~---~--~---
18 matches
Mail list logo