ManyRelatedManager object Question
Hello. I have a model that draws info from another class, so basically a ManyToMany field and want to display this information in my template. in my models.py I have the following. MODELS.PY class Geo(models.Model): title = models.CharField(max_length=30) class Specie(models.Model): geo_location = models.ManyToManyField(Geo) VIEWS.PY latest_animals = Specie.objects.all() countries = latest_animals.geo_location_set.all() context = { 'latest_animals': latest_animals, 'countries': countries, } TEMPLATE FILE {% for country in countries.all %} {{ country }} {% endfor %} What I really want is to display the country information which contains multiple items that were selected. Can anybody help me with this one? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: ManyRelatedManager object Question
figured it out. Nevermind On May 17, 11:30 am, appel268576 wrote: > Hello. > > I have a model that draws info from another class, so basically a > ManyToMany field and want to display this information in my template. > > in my models.py I have the following. > > MODELS.PY > > class Geo(models.Model): > title = models.CharField(max_length=30) > > class Specie(models.Model): > geo_location = models.ManyToManyField(Geo) > > VIEWS.PY > > latest_animals = Specie.objects.all() > countries = latest_animals.geo_location_set.all() > context = { 'latest_animals': latest_animals, 'countries': > countries, } > > > TEMPLATE FILE > {% for country in countries.all %} > {{ country }} > {% endfor %} > > What I really want is to display the country information which > contains multiple items that were selected. > > Can anybody help me with this one? > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-us...@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group > athttp://groups.google.com/group/django-users?hl=en. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
user registration extras
hi there. I am having some issues and don't really know where to go to with this. I am using the django-registration from bitbucket which is very handy, however I would like to pass extra items upon registration such as 'first name', 'last name' etc. any ideas? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Django c _imaging module not installed
Hi there. For the last week or so I have been having real issues with getting Django / python and libjpeg to play nice. However successfully followed loads of threads and comments and got my own solution. Secondly I have applied this solution so that it works successfully on my production server. Question I have though is why does it still not pick up the _imaging module. Here are the steps I took. I already had jpeg-7 and Imaging-1.1.7 on my server. I removed /opt/python2.6/lib/python2.6/site-packages/PIL and the PIL.pth file I deleted Imaging-1.1.7 and replaced it with 1.1.6 (as this is supposedly more stable) I then cd'd into my src directory where all my source files are. in jpeg-7 i ran the following statements. sudo make clean (this removed all previuses build and all references to *jpeg*) sudo ./configure --enable-shared --enable-static sudo make sudo make install then cd'd into my Imaging-1.1.6 directory and ran the following sudo rm -Rf build (to remove any previous builds) sudo python setup.py build sudo python setup.py install sudo python selftest.py (57 test passed) no errors. then i go into my directory where my django app lives and I execute the following python manage.py shell import Image (no errors) import PIL (no errors) import _imaging (no errors) i = Image.open("/path/to/my/image.jpeg") i.save("/path/to/my/new_image.jpeg") works without any errors. However... running the admin through django still causes me "c _imaging module not installed" Any help would be greatly appreciated. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: django-friends | setup views.py with templates
Hi. I ma having the same problem. Could you find any documentation on this? On Sep 6, 10:13 pm, justin jools wrote: > Hi I have setup jtauber notification and friends apps but now I am > stuck as to how to add views/urls to produce add friends/friends > accept/friends list etc. > > please help me through the process > thx > > On 6 Sep, 18:24, justin jools wrote: > > > > > trying to setup simple social network > > have installed: registration, profiles, accoutns, messages > > > but am stuck as how to setup/link the views.py to templates/ > > notification. I guess this is what is needed to be done. > > > Any help much appreciated -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.