Saving with unchanged value by default in ModelForm

2009-07-11 Thread Streamweaver
When using a ModelForm object to edit data is there any way to tell Django to save only data included in the ModelForm object and keep whatever was in the other fields in the model? I find it a big barrier to have to explicitly define fields after commit=False just so they don't get nulled out, i

Re: Add extra field to ModelForm

2009-07-11 Thread adelaide_mike
Thanks Alex. A simpler way out would be if the agent field, which is a foreign key pick list, could be caused to show only those values I determine dynamically. Is this possible in a ModelForm? Mke On Jul 12, 12:17 am, Alex Gaynor wrote: > On Sat, Jul 11, 2009 at 10:08 AM, adelaide_mike > >

Re: Unit testing views.

2009-07-11 Thread J. Clifford Dyer
Woot! Thank you. I'll be pestering my sysadmins about that starting with our Tuesday meeting this week. :) Cheers, Cliff On Sat, 2009-07-11 at 22:32 +0800, Russell Keith-Magee wrote: > On Fri, Jul 10, 2009 at 1:02 PM, J. Clifford Dyer > wrote: > > > > On Fri, 2009-07-10 at 07:58 +0800, Russe

Re: Run the Django Site in Apache

2009-07-11 Thread dartdog
If you are using a web hosting company they often have some good material, particularly Webfaction, you can look at their support for a lot of material on this topic. On Jul 11, 3:17 pm, Kannan wrote: > Hi Friends... >           I am new to the Django.Just learning about the Django.I have > crea

Re: Run the Django Site in Apache

2009-07-11 Thread Dennis Kaarsemaker
On Sat, Jul 11, 2009 at 10:17 PM, Kannan wrote: > > Hi Friends... >   I am new to the Django.Just learning about the Django.I have > created a django application & run it runs only django server. > How can i run the django site in the Apache server. > Pls help me to solve this problem.

Run the Django Site in Apache

2009-07-11 Thread Kannan
Hi Friends... I am new to the Django.Just learning about the Django.I have created a django application & run it runs only django server. How can i run the django site in the Apache server. Pls help me to solve this problem. With regards, Kannan. R. P, --~--~-~--~~-

Sending JSON response from views

2009-07-11 Thread Oleg Oltar
Hi! I am trying to implement something like a jubber web application, using django and flex The server code should send a list of users who's online. Here's how I defined a model class ActiveList(models.Model): STATUS_CHOISES = ( (u'F', u'free'), (u'B', u'busy'), )

Re: uploaidng media files ( such as mp3, images ) tutorial/how-to?

2009-07-11 Thread djangonoob
hey, i've managed to fix the problem successfully. thank u for your time. On Jul 11, 5:38 pm, Daniel Roseman wrote: > On Jul 11, 9:11 am, djangonoob wrote: > > > > > Hi all, > > may i know how do i upload media files such as mp3 files, images using > > djanog? > > > I understand that there is a

Re: Does post_save signal need to be in models.py?

2009-07-11 Thread Brian Neal
On Jul 11, 12:54 pm, Ryan K wrote: > I am trying to avoid circular dependency issues  between signals.py > and models.py. Is there any reason why I can't connect the post_save > signal in signals.py itself (the function is connects with would be in > the same file? Should I import it in the apps/

Re: Adding a custom field to an admin model (table)

2009-07-11 Thread Tavish
Sorry, accidentally pressed "send" ok, where was I...? class SomeModel(models.Model): name = models.CharField(bla bla bla) #Don't let them edit log_entries in admin log_entries = models.ManyToManyField(LogEntry, editable=False) #have a field where they can edit their change

Does post_save signal need to be in models.py?

2009-07-11 Thread Ryan K
I am trying to avoid circular dependency issues between signals.py and models.py. Is there any reason why I can't connect the post_save signal in signals.py itself (the function is connects with would be in the same file? Should I import it in the apps/__init__.py file to ensure the signal is ins

Re: Adding a custom field to an admin model (table)

2009-07-11 Thread Tavish
I'm fairly new to django and programming in general, but I'll give it a shot: Could you define a separate model for LogEntry's? If you had a separate model for the log entries, you could easily define a many-to- many field to link them. This isn't semantically beautiful, but it might work. Here'

submit form

2009-07-11 Thread alecs
Hi! I think it's more web development question than django question, but hope someone can advice me. I have a table with checkboxes. Each contains different information about files (filename, filesize, url, etc). Below this table I have three(or maybe more) buttons to perform different actions wi

Re: Design Tools any suggestions?

2009-07-11 Thread dartdog
Graph models looks really cool but for code already done as opposed to planning it out! But I think I really want to give it a go. On Jul 11, 11:17 am, Adam N wrote: > GraphModels in django-extensions can be helpful. > > http://code.google.com/p/django-command-extensions/wiki/GraphModels > > I h

Re: ImportError: No module named urls

2009-07-11 Thread Karen Tracey
On Sat, Jul 11, 2009 at 12:26 PM, selcukcihan wrote: > > Using trunk with apache + mod_wsgi, > > Hi, i also have url problems with admin. First of all, if i use the > depreciated method(r'^admin/(.*)', admin.site.root) everything works > fine. > > Well, since there is a new method, i switched to

Re: ImportError: No module named urls

2009-07-11 Thread selcukcihan
Using trunk with apache + mod_wsgi, Hi, i also have url problems with admin. First of all, if i use the depreciated method(r'^admin/(.*)', admin.site.root) everything works fine. Well, since there is a new method, i switched to it; using (r'^admin/', include(admin.site.urls)). The problem is on

Re: Design Tools any suggestions?

2009-07-11 Thread Adam N
GraphModels in django-extensions can be helpful. http://code.google.com/p/django-command-extensions/wiki/GraphModels I had a bear of a time installing it on my Mac however. Graphviz isn't Visio or a UML editor though so the utility of that program for model designing is kind of limited. On Jul

Re: Add extra field to ModelForm

2009-07-11 Thread Alex Gaynor
On Sat, Jul 11, 2009 at 10:08 AM, adelaide_mike wrote: > > Django 1.0.2. My ModelForm concerns (and is based on the table for) > advertisements for houses placed by real estate agents. > > I need the agent widget (which by default is a pick list of all > agents), to be modified on the form to be

Re: Design Tools any suggestions?

2009-07-11 Thread dartdog
Just looked through the Eclipse site, anyone have any opinions as to which free UML tool is worth looking at? Lots there but many/most inactive? On Jul 11, 8:53 am, dartdog wrote: > Thank to both Unfortunately I'm on Windows Vista, so It looks like > Umbrello is not yet ready, looks nice though,

Add extra field to ModelForm

2009-07-11 Thread adelaide_mike
Django 1.0.2. My ModelForm concerns (and is based on the table for) advertisements for houses placed by real estate agents. I need the agent widget (which by default is a pick list of all agents), to be modified on the form to be either (depending on circumstances) a non-editable preset display

Re: Unit testing views.

2009-07-11 Thread Russell Keith-Magee
On Fri, Jul 10, 2009 at 1:02 PM, J. Clifford Dyer wrote: > > On Fri, 2009-07-10 at 07:58 +0800, Russell Keith-Magee wrote: >> On Fri, Jul 10, 2009 at 3:23 AM, J. Cliff Dyer wrote: >> > > I am using the django testcase, but without fixtures, because loading > fixtures is busted when you use a m2m r

Re: uploaidng media files ( such as mp3, images ) tutorial/how-to?

2009-07-11 Thread newlife
''django'' On 7月11日, 下午4时11分, djangonoob wrote: > Hi all, > may i know how do i upload media files such as mp3 files, images using > djanog? > > I understand that there is a documentation on file uploads at > :http://docs.djangoproject.com/en/dev/topics/http/file-uploads/ > > However, i do no

Re: Design Tools any suggestions?

2009-07-11 Thread dartdog
Thank to both Unfortunately I'm on Windows Vista, so It looks like Umbrello is not yet ready, looks nice though,,and I've started off with eclipse so that particular UML is out perhaps I'll take a closer look at the Eclipse offerings... Any one else have best practices?? I'sm wondering what the D

Re: inlineformset delete on empty revisited

2009-07-11 Thread patrickk
maybe this helps (well ... it probably doesn´t help, but it maybe clarifies): http://code.djangoproject.com/ticket/10828 regards, patrick On 11 Jul., 08:11, nbv4 wrote: > http://pastebin.com/f40a3bde9 > > I found this little snippet on this group and am trying to get it to > work on my model, b

Re: syncdb error

2009-07-11 Thread Croydon Dias
Thanks a bunch. Converted all path's to forwards slashes which fixed the problem. --~--~-~--~~~---~--~~ 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.co

Re: Customised admin saving

2009-07-11 Thread Daniele Procida
On Sat, Jul 11, 2009, Daniel Roseman wrote: >> I think this means that I need to add a routine to my admin.py so that >> when the user hits Save, it will also manually assemble the information >> and save it for the affected models. >> >> Is that correct? If so, what is doing this called, so I c

Re: syncdb error

2009-07-11 Thread Karen Tracey
On Sat, Jul 11, 2009 at 7:49 AM, Croydon wrote: > > This is my first time running django in windows xp. Im using xampp, > python2.5.4 and django1.0.2 > > I created a new sqlite3 database and I get the following error when I > run "python manage.py syncdb" > > http://imgur.com/pooSw.png"; alt="Hos

Re: Customised admin saving

2009-07-11 Thread Friðrik Már Jónsson
Daniele Procida wrote: > I think this means that I need to add a routine to my admin.py so that > when the user hits Save, it will also manually assemble the information > and save it for the affected models. > > Is that correct? If so, what is doing this called, so I can look it up > in the docu

syncdb error

2009-07-11 Thread Croydon
This is my first time running django in windows xp. Im using xampp, python2.5.4 and django1.0.2 I created a new sqlite3 database and I get the following error when I run "python manage.py syncdb" http://imgur.com/pooSw.png"; alt="Hosted by imgur.com" /> --~--~-~--~~~-

Re: Customised admin saving

2009-07-11 Thread Daniel Roseman
On Jul 11, 11:37 am, "Daniele Procida" wrote: > I have a many-to-many relationship between two models, People and > Entities (enities are departments and offices etc). > > Some of these relationships are managed by the user in admin, but others > are implicit. > > For example, if the user adds Jo

Customised admin saving

2009-07-11 Thread Daniele Procida
I have a many-to-many relationship between two models, People and Entities (enities are departments and offices etc). Some of these relationships are managed by the user in admin, but others are implicit. For example, if the user adds John to the Laser Research Lab Administrative Office, it me

Re: Creating a model and related models with Inline formsets

2009-07-11 Thread chefsmart
I had posted this on stackoverflow.com and this got answered there. Follow this link for the solution: - http://stackoverflow.com/questions/1113047/creating-a-model-and-related-models-with-inline-formsets On Jul 11, 1:46 am, chefsmart wrote: > Hi, > > Using the example > athttp://docs.djangopr

Re: uploaidng media files ( such as mp3, images ) tutorial/how-to?

2009-07-11 Thread Daniel Roseman
On Jul 11, 9:11 am, djangonoob wrote: > Hi all, > may i know how do i upload media files such as mp3 files, images using > djanog? > > I understand that there is a documentation on file uploads at > :http://docs.djangoproject.com/en/dev/topics/http/file-uploads/ > > However, i do not quite under

Re: Adding a custom field to an admin model (table)

2009-07-11 Thread Haestan
> I would like to add a custom field to an existing admin model, namely > LogEntry. The goal is to add a comment field, where custom change > comments can be added in the admin whenever a model is saved. > > Is it even possible to add such a field without changing the existing > admin codebase? Or

Re: Django contrib apps in different db schema

2009-07-11 Thread Haestan
> I'm trying to use Django for implementing new stuff in some of our legacy > apps. > All the existing apps use PostgreSQL as their database backend. Now in > order to > do this as transparent as possible, I'd like to use a different database > schema > for the contrib apps that come with Djang

uploaidng media files ( such as mp3, images ) tutorial/how-to?

2009-07-11 Thread djangonoob
Hi all, may i know how do i upload media files such as mp3 files, images using djanog? I understand that there is a documentation on file uploads at : http://docs.djangoproject.com/en/dev/topics/http/file-uploads/ However, i do not quite understand the interaction between the models, views and t