Re: inline queryset dependant on runtime data

2009-10-07 Thread sico
Also, any change in the Link from_hub or to_hub will result in the form being reloaded so no need to change the dropdown lists after being loaded On Oct 8, 9:22 am, sico <allensi...@gmail.com> wrote: > by the way, I'm using django 1.0.2  but am not against upgrading > if

Re: inline queryset dependant on runtime data

2009-10-07 Thread sico
by the way, I'm using django 1.0.2 but am not against upgrading if it helps me solve this problem! On Oct 7, 3:36 pm, sico <allensi...@gmail.com> wrote: > Suppose I have 4 models as below: > > class Hub(models.Model): >     name = models.CharField("Name&q

inline queryset dependant on runtime data

2009-10-06 Thread sico
Suppose I have 4 models as below: class Hub(models.Model): name = models.CharField("Name", ) something-else = models.CharField("Something", ) class HubPlug(model.Model): hub = models.ForeignKey(Hub) plug_id = models.CharField("Plug Id (A, B, C, etc)", ) class Link(model.Model):

alternative to using index number to refer to inline admin formsets in template?

2009-08-30 Thread sico
Hey, I can get to the inline_admin_formset by indexing the inline_admin_formsets variable e.g. {{ inline_admin_formsets.0.formset }} is there an alternative to use the index number for picking the formset?? I've tried the model name but it doesn't seem to work... any suggestions?? thanks,

multiple admin interfaces for a single model

2009-08-30 Thread sico
Hey, Is it at all possible to have more than one admin interface for one model? I'd like to have a simple view that just edits the one model fields, and another (maybe more) that edit the model, plus several inline associated models. I can get this to work by having separate AdminSites, is

Re: formset consisting of multiple models/forms

2009-08-03 Thread sico
the binding of the data from the form to the model. thanks, Simon On Aug 4, 1:12 pm, sico <allensi...@gmail.com> wrote: > Hi, > > I have several models linked OneToOne by their primary keys. > > I can make a single view that has a form for each model and allow the > user to

formset consisting of multiple models/forms

2009-08-03 Thread sico
Hi, I have several models linked OneToOne by their primary keys. I can make a single view that has a form for each model and allow the user to edit data from the each of the models in a single screen (as if it were all stored in a single table/model) I'd like to be able to do this in a grid,

multiple admin forms for one model

2009-07-30 Thread sico
Is it possible to have more than one admin interface for a form in the same AdminSite ? I'd like to have an admin form for just editing the model, and another one for editing the model and some sub-records. Is this possible within the same AdminSite ?? You're not allowed to do more than one:

Re: view/form with fields from multiple models

2009-07-30 Thread sico
Hey, I've been a little distracted but I'm back on to this now... Thanks for the information, I'm going to try it out now (assuming no more interruptions!) and I'll get back to you on how I get on... On Jul 24, 8:55 pm, Matthias Kestenholz wrote: > On Fri,

overriding clean method on ModelForm class

2009-07-30 Thread sico
Hey, I had a problem recently that caused me some confusion! I have a model that has a OneToOne field as the primary key. When adding a new record in the admin form and entering a key that already existed, I wasn't getting the expected "record already exists" error, instead it was just

view/form with fields from multiple models

2009-07-23 Thread sico
Hi, I want to be able to edit fields from several different models on the same form/view. The models are related one-to-one... can they be defined as "Inline" forms in the admin system?? The documentation doesn't make any mention of using inline forms for anything except parent child relations

Re: customizing admin template - how to refer to specific field

2009-07-22 Thread sico
This has been put in the "too hard" basket for now. I'm upgrading from django 0.96 to 1.0.2 and was hoping to make this custom view a configured admin view but am leaving that till later now as it's taking too much time away from porting the rest of the system. On Jul 21, 11:4

Re: customizing admin template - how to refer to specific field

2009-07-20 Thread sico
report back as soon as I can test it On Jul 21, 11:32 am, Joshua Russo <josh.r.ru...@gmail.com> wrote: > On Mon, Jul 20, 2009 at 10:26 PM, sico <allensi...@gmail.com> wrote: > > > thats cool to know, but not quite what I'm after I don't think.  If > > the

Re: colMS and how to put stuff in sidebar??

2009-07-20 Thread sico
I'm thinking overriding the change_view on the admin model - add the extra data to extra_context and then reference it as Rajeesh suggested below... On Jul 21, 9:08 am, sico <allensi...@gmail.com> wrote: > heh... right you are! > > But how do I make extra data from other models av

Re: customizing admin template - how to refer to specific field

2009-07-20 Thread sico
fields depending on a data value e.g. if field1 = 1 then hide field7 else hide field8 On Jul 20, 11:47 pm, rajeesh <rajeeshrn...@gmail.com> wrote: > On Jul 20, 9:38 am, sico <allensi...@gmail.com> wrote: > > > > > Its quite simple to customize the admin

Re: colMS and how to put stuff in sidebar??

2009-07-20 Thread sico
<rajeeshrn...@gmail.com> wrote: > On Jul 20, 4:06 am, sico <allensi...@gmail.com> wrote: > > > Hi, > > > Using django 1.0.2 and I'd like to put some extra read-only info in a > > sidebar on the editing forms for specific models. > > > coltype= colMS

customizing admin template - how to refer to specific field

2009-07-19 Thread sico
Its quite simple to customize the admin template for a specific model by creating a change_form.html in the templates/admin// / directory. But, is it possible to refer to particular fields in the model/form directly? E.g. Instead of using the loops: for fieldset in adminform: for

colMS and how to put stuff in sidebar??

2009-07-19 Thread sico
Hi, Using django 1.0.2 and I'd like to put some extra read-only info in a sidebar on the editing forms for specific models. coltype= colMS looks perfect for this, but how/where do I tell django what I want to put in the sidebar?? thanks, Simon

Re: about a web site

2009-07-17 Thread Diego Eduardo Ahumada - SICO S.I. S.A.
2009/7/17 Michael : > On Fri, Jul 17, 2009 at 1:30 PM, Lic. José M. Rodriguez Bacallao > wrote: >> >> anyone? >> >> >> On 7/17/09, Lic. José M. Rodriguez Bacallao wrote: >> > hi folks, it's be a long time without writing to the list but

Re: how to alter (add/del cols) the tables from the existing models

2009-07-17 Thread Diego Eduardo Ahumada - SICO S.I. S.A.
2009/7/17 Lokesh : > > Hi, > > Initially the table created with the following code > Class user_privileges(models.Model): >    user_id = models.ForeignKey(User) >    is_deleted= models.CharField(null=False, blank=False, > max_length=1) >    is_email_active =

Re: foreign key validation

2009-07-12 Thread sico
okay... seems the use of a Manipulator was the issue, and adding raw_id_admin = True to the Foreign Key field definition fixed it! On Jul 13, 9:58 am, sico <allensi...@gmail.com> wrote: > <I'm sure I already posted this but I can't find it anywhere so > reposting> > > Ca

foreign key validation

2009-07-12 Thread sico
Can anyone shed some light on how django validates foreign keys for me?? I have a model that I'm writing a whole lot of records in a single request. With the Foreign Key defined in the model it takes ages!!! Have about

foreign key validation

2009-07-07 Thread sico
Can anyone shed some light on how django validates foreign keys for me?? I have a model that I'm writing a whole lot of records in a single request. With the Foreign Key defined in the model it takes ages!!! Have about 100 records and it takes minutes. When I change the field to CharField, it

Re: rollback transaction without an exception when transaction is tied to http requests

2009-06-29 Thread sico
So, using automatic transaction management, there is no way to cause a transaction rollback without the user seeing the exception... stink... thanks for your help! On Jun 30, 3:07 am, Karen Tracey <kmtra...@gmail.com> wrote: > On Sun, Jun 28, 2009 at 11:14 PM, sico <allensi...@gmai

Re: rollback transaction without an exception when transaction is tied to http requests

2009-06-28 Thread sico
the transaction without the user seeing an exception thanks! On Jun 26, 11:13 pm, Karen Tracey <kmtra...@gmail.com> wrote: > On Fri, Jun 26, 2009 at 12:59 AM, sico <allensi...@gmail.com> wrote: > > > Hi > > > Is it possible to rollback the transaction without raising an &g

rollback transaction without an exception when transaction is tied to http requests

2009-06-25 Thread sico
Hi Is it possible to rollback the transaction without raising an exception when the transactions are tied to http requests?? I'm writing several records in one post call, if any fail I'd like to rollback the transaction but return a nice error message to the user. Surely I'm missing something as

can't adapt error

2009-06-23 Thread sico
Hey, I was getting a weird can't adapt error when saving a record. Previous posts talked about charset conversions, unicode, etc... The problem I had turned out to be trying to write an object reference where I should have put the key value instead. e.g. rec["myfk"] = myObj changed to:

Re: Filter model and retrieve associated model/objects at same time

2009-01-19 Thread sico
btw... using 0.96 here... On Jan 20, 9:27 am, sico <allensi...@gmail.com> wrote: > Hi, > > I'm filtering a model on some criteria... and based on the resultset I > want to retrieve associated related models (all one-to-one > relationships) > > Whats the most effic

Filter model and retrieve associated model/objects at same time

2009-01-19 Thread sico
Hi, I'm filtering a model on some criteria... and based on the resultset I want to retrieve associated related models (all one-to-one relationships) Whats the most efficient way to do this without resorting to custom SQL? this is the best I can come up with: obj1s =

Re: form for model - with a few changes

2009-01-15 Thread sico
I suppose I want to know if there is anyway to customize the field output at runtime to add properties like class, disabled etc... Would rather not use javascript too . On Jan 16, 1:53 pm, sico <allensi...@gmail.com> wrote: > doh!  its one thing being stupid... its another bei

Re: form for model - with a few changes

2009-01-15 Thread sico
doh! its one thing being stupid... its another being stupid in front of a big crowd of people! if my field is readonly... it probably doesn't need a dropdown list does it?? would still be nice to set date field text box class to vDateField to get nice pop-up thingy! On Jan 16, 1:38 pm, sico

form for model - with a few changes

2009-01-15 Thread sico
Hi, I've inherited a django app - running on 0.96. So far, the people before me have not created any views, and have just used the built-in admin app to modify everything. I want to create a view to control adding/editing records for a specific model. #So, I create form from the model like:

temperamental ImportError

2008-11-12 Thread sico
just an FYI here as have fixed the problem. was getting the error as described here http://groups.google.com/group/django-users/browse_thread/thread/04fa8425d18f9242 but only every so often then I noticed the ProcessID at the top of the error was always the same. Apache was running 11