Re: form.save() fails silently - how to debug?

2012-07-27 Thread Derek
The clean() method basically stores the non-model field data in the model's dictionary field. If this method was faulty, then it would also cause problems in the test code. As I said, when I print the data to console it looks OK. I am still trying to find how and where the save() method indi

_set.all()

2012-07-27 Thread David
Hello This may be more of a Python question that a Django question, but ... I am trying to make one of my apps more abstract. Using _set.all() I can return all of the m2m relations. I can then loop through them doing what I like *providing *I know the model field names. if not isinstance(f, Ge

Re: _set.all()

2012-07-27 Thread David
hmm nvm print unicode(a) seems to do the trick. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/KR3z7jzCPusJ. To post to this group, send email to django-

Need urgrnt help for this new bee...

2012-07-27 Thread Soumen
Hi All, I am new to this web server world. I have a specific issue for certain application. Need your assistance to solve. The whole scenario is like this: - 1) For one of my application I need to fetch images from server for showing on the client. 2)

Re: ignore field during form validation

2012-07-27 Thread Karen Tracey
On Thu, Jul 26, 2012 at 11:14 AM, Zoltan Szalai wrote: > Hi all, > > Let's assume i have to the following simple form: > > > class Form(forms.Form): > > check = forms.BooleanField( > required=False, > ) > # take into account only when 'check' is True > len = forms.IntegerFi

Re: form.save() fails silently - how to debug?

2012-07-27 Thread Karen Tracey
On Fri, Jul 27, 2012 at 3:25 AM, Derek wrote: > The clean() method basically stores the non-model field data in the > model's dictionary field. If this method was faulty, then it would also > cause problems in the test code. As I said, when I print the data to > console it looks OK. I am still

Re: Need urgrnt help for this new bee...

2012-07-27 Thread kenneth gonsalves
On Fri, 2012-07-27 at 04:39 -0700, Soumen wrote: > 1) For one of my application I need to fetch images from server for > showing on the client. > 2) Those images will come from different web servers. > 3) These images will be scraped by a python script and will be saved > into the respective folder

Returning data belonging to a model (FK)

2012-07-27 Thread David
Hi I am trying to abstract one of my applications. for f in self._meta.fields: print f if f.get_internal_type() == "ForeignKey": for o in f.related.parent_model.objects.all(): I am using the above code to isolate any fields in self._meta.fields tha

Re: Returning data belonging to a model (FK)

2012-07-27 Thread Victor Rocha
David, Django already comes with a built-in contenttypes application which does exactly what you trying to accomplish, i think. You should read the documentation: https://docs.djangoproject.com/en/dev/ref/contrib/contenttypes/ On Friday, July 27, 2012 8:47:37 AM UTC-4, David wrote: > > Hi > >

Newbie question about accesing my development Django instance from other computers in my LAN

2012-07-27 Thread Miguel Lavalle
Hi, I am new to Django. I am developing my first app on a Windows 7 laptop. I want other people to be able to connect to this app. As indicated in the documentation, I start the server with: python manage.py runserver 0.0.0.0:8000 And then I try to access my app from another laptop pointing th

Re: Need urgrnt help for this new bee...

2012-07-27 Thread Soumen
Hi, I have just configured the Django webserver on our local server and able to get the data from the APP42 server to the client. Now what are the remaining steps i should follow? On Friday, July 27, 2012 5:09:31 PM UTC+5:30, Soumen wrote: > > Hi All, > I am new to this web server world. I have

Re: Returning data belonging to a model (FK)

2012-07-27 Thread David
Hi Victor I am using contenttypes already and am finding it hugely useful. I am trying to decouple the applications need to "know" the model that the contenttype has linked to. This way it should generically understand, interpret and perform functions on any given instance of an object regardl

permission denied eror

2012-07-27 Thread Harjot Mann
hello everyone I installed django and its working under pyhton bt when i typed the follwing command django-admin.py startproject mysite im geting these errors Traceback (most recent call last): File "/usr/local/bin/django-admin.py", line 5, in management.execute_from_command_line() Fi

Re: Newbie question about accesing my development Django instance from other computers in my LAN

2012-07-27 Thread Christopher Downard
Try python manage.py runserver 192.168.1.116 where that address is your computer's address. On Jul 27, 2012 7:15 AM, "Miguel Lavalle" wrote: > Hi, > > I am new to Django. I am developing my first app on a Windows 7 laptop. I > want other people to be able to connect to this app. As indicated in t

Re: form.save() fails silently - how to debug?

2012-07-27 Thread Derek
Thanks Karen I am not quite sure what you mean by "Model save() would indicate an error" - I am making a call to the form.save(), which in turn, I assume, should result in the data being saved to the model (although nothing gets saved in my case)? No error is being raised that I can see. I

access cleaned_data values outside done()

2012-07-27 Thread Leandro Alves
Hi guys, Is it possible to access the "form.cleaned_data" values from another function that is not part of a form-wizard? For example, I have a view like this: # form-wizard class PatchWizard(SessionWizardView): def done(self, form_list, **kwargs): * < here i have the values of t

Re: permission denied eror

2012-07-27 Thread Leandro Alves
Did you try: sudo django-admin.py startproject mysite ? On Friday, July 27, 2012 3:20:54 PM UTC+2, Harjot Mann wrote: > > > hello everyone > > I installed django and its working under pyhton bt when i typed the > follwing command > django-admin.py startproject mysite > > im geting these errors

Re: Add a form to admin side

2012-07-27 Thread Leandro Alves
This is a good start: https://docs.djangoproject.com/en/1.4/topics/forms/ Leandro On Friday, July 27, 2012 5:47:32 AM UTC+2, TRAN PHONG PHU wrote: > > I need to create a form to admin-side with two fields > >1. Number of code: integer >2. Value of code: float > > How can I do that. Thi

Re: permission denied eror

2012-07-27 Thread Rafael E. Ferrero
Thats because you dont have django-admin.py in your pythonpath, in djangoproject documentation you have clearly explain how you can do this work. See ya 2012/7/27 Harjot Mann > > hello everyone > > I installed django and its working under pyhton bt when i typed the > follwing command > django-a

Re: form.save() fails silently - how to debug?

2012-07-27 Thread Dan Gentry
I too am a little confused by the clean() method and the data_set field. It seems that the data_set would contain a copy of the ID value for a change operation, and be None for an add. What purpose does that serve? Perhaps comment the clean() method just to see if the other fields can be save

Re: Models: Referencing A Model In Another App and Different Project

2012-07-27 Thread Melvyn Sopacua
On 27-7-2012 6:17, JJ Zolper wrote: > You are probably right to be honest. I might be overdoing it with > seperating things apart. I guess sometimes I'm too efficient! > > Here's some more to chew on though: > > I also want to point out the reason why I am trying to bring one model into > anoth

Re: Automated updating of data across staging and production environments?

2012-07-27 Thread Kevin Daum
Do you need to preload the staging database with production data in order to properly test the site? If not, you could create a fresh staging database (no data) every time you update staging. After people test it and if there are no issues, you could use dumpdata with natural keys to export the

Re: Newbie question about accesing my development Django instance from other computers in my LAN

2012-07-27 Thread Miguel Lavalle
Thanks. It didn't work, though. In the development laptop I started the server with python manage.py runserver 192.168.1.116:8000 In the laptop where I am trying to access the app, I typed in the browser: 192.168.1.116:8000

Re: Return SQL calculation within queryset

2012-07-27 Thread Jonathan Baker
Thanks for the direction, AT. Below is my final code in case anyone else encounters a similar problem: class LocationManager(models.Manager): ''' ''' def nearby_locations(self, latitude, longitude, proximity, category): ''' ''' cursor = connection.cursor()

Re: Newbie question about accesing my development Django instance from other computers in my LAN

2012-07-27 Thread Christopher Downard
Assuming both laptops are connected to the same local network (192.168.1.*) then it should be able to access the server. Are you getting a page not found or are you getting an error with the URLs? My server starts up just fine with python manage.py runserver 192.168.1.149:8020 (my lan's info). I

Re: Newbie question about accesing my development Django instance from other computers in my LAN

2012-07-27 Thread Bill Freeman
The 0.0.0.0:8000 argument to runserver is the right way to do this. (Apparently 0:8000 us a legal shortcut.) But you may have a firewall on your machine which is not allowing access to port 8000. You will have to find someone (maybe you) with specific knowledge of firewall configuration on your p

Re: How is the label_tag's attrs parameter supposed to specified?

2012-07-27 Thread Doogster
A filter that takes a label_tag isn't a bad solution: @register.filter(is_safe=True) def label_with_classes(value, arg): return value.label_tag(attrs={'class': arg}) And then, in the template: {{ form.my_field|label_with_classes:"class1 class2"}} On Fri, Jul 20, 2012 at 11:52 AM, Tomas Nem

Re: Need urgrnt help for this new bee...

2012-07-27 Thread Doogster
Everything you've written indicates that the "remaining step you should follow" is to hire someone. That's the only way you're going to get the "urgent help" that you need. On Fri, Jul 27, 2012 at 6:14 AM, Soumen wrote: > Hi, > I have just configured the Django webserver on our local server and a

Best Beginning Tutorial for Django 1.4

2012-07-27 Thread ACK-Django
hello, guys i m new to django as well as python. i know its important to learn python before django so just an hour ago i finished the book => http://www.swaroopch.org/notes/Python ( A Byte of Python 2.xx version ) now i wanted to learn django very deeply and along the way i will also look at py

Re: Best Beginning Tutorial for Django 1.4

2012-07-27 Thread Doogster
pyvideo.org is a good resource. On Fri, Jul 27, 2012 at 11:53 AM, ACK-Django wrote: > hello, guys i m new to django as well as python. > i know its important to learn python before django > so just an hour ago i finished the book => > http://www.swaroopch.org/notes/Python ( A Byte of Python 2.xx

Re: Best Beginning Tutorial for Django 1.4

2012-07-27 Thread ACK-Django
thanks for your very fast reply On Saturday, July 28, 2012 12:29:04 AM UTC+5:30, doogster wrote: > > pyvideo.org is a good resource. > > On Fri, Jul 27, 2012 at 11:53 AM, ACK-Django > wrote: > > hello, guys i m new to django as well as python. > > i know its important to learn python before d

Re: Best Beginning Tutorial for Django 1.4

2012-07-27 Thread Demian Brecht
First off, I think a good question to ask is *why* do you want to learn Django very deeply? Do you want to become a contributor to the project or do you want to be a user? If you want to be a user, then I'd recommend against getting too deep in Django (at least until it's absolutely necessary). The

Re: Best Beginning Tutorial for Django 1.4

2012-07-27 Thread Babatunde Akinyanmi
Read the documentation, recreate the project in the documentation tutorial then work on a project of your own. You can't learn to swim by reading books, same for programming. My 50 kobo On 7/27/12, ACK-Django wrote: > hello, guys i m new to django as well as python. > i know its important to lea

Re: Best Beginning Tutorial for Django 1.4

2012-07-27 Thread ANIKET KADAM
good answer, first i want to be a *user* of this project any strong tips for this On Sat, Jul 28, 2012 at 12:37 AM, Demian Brecht wrote: > First off, I think a good question to ask is *why* do you want to learn > Django very deeply? Do you want to become a contributor to the project or > do you w

Re: Best Beginning Tutorial for Django 1.4

2012-07-27 Thread ANIKET KADAM
yes, you are right On Sat, Jul 28, 2012 at 12:38 AM, Babatunde Akinyanmi wrote: > Read the documentation, recreate the project in the documentation > tutorial then work on a project of your own. You can't learn to swim > by reading books, same for programming. > > My 50 kobo > > On 7/27/12, ACK-D

Re: Best Beginning Tutorial for Django 1.4

2012-07-27 Thread ANIKET KADAM
is Django book => http://www.djangobook.com/en/2.0/ is good start for django1.4 => but book cover django1.0 so its a good idea to go with book. On Sat, Jul 28, 2012 at 12:47 AM, ANIKET KADAM wrote: > yes, you are right > > > On Sat, Jul 28, 2012 at 12:38 AM, Babatunde Akinyanmi < > tundeba...@g

Re: Need urgrnt help for this new bee...

2012-07-27 Thread Kurtis Mullins
Break down your problem into smaller, abstract pieces. Then start implementing them one piece at a time. If you don't know how to do something specific, I'm sure people will be more than willing to help. But asking "How do I accomplish a large task" isn't going to bring you much help, unfortunately

Re: permission denied eror

2012-07-27 Thread Harjot Mann
yes i tried it is creating a folder named mysite but inside this folder there are no files llike maange.py etc On Fri, Jul 27, 2012 at 7:35 PM, Leandro Alves wrote: > Did you try: > > sudo django-admin.py startproject mysite > > ? > > > On Friday, July 27, 2012 3:20:54 PM UTC+2, Harjot Mann wrot

Re: permission denied eror

2012-07-27 Thread Harjot Mann
Rafael E. Ferrero can u pls send me the link On Sat, Jul 28, 2012 at 10:05 AM, Harjot Mann wrote: > yes i tried it is creating a folder named mysite but inside this folder > there are no files llike maange.py etc > > > On Fri, Jul 27, 2012 at 7:35 PM, Leandro Alves wrote: > >> Did you try: >> >>

Re: Url regex keeps django busy/crashing

2012-07-27 Thread Russell Keith-Magee
On Thu, Jul 26, 2012 at 10:45 PM, Joe wrote: > Hey, I have a url regex like this which is keeping django extremely busy > (20secs to 1min to handle a request). On some urls it even crashes. > > my regex: > > url(r'^(?P(\w+-?)*)/$', 'detail'), > > > view: > > def detail(request, item_url): >i =