Re: help with foreign keys in admin

2011-02-02 Thread Karl Bowden
On 3 February 2011 16:14, Bobby Roberts wrote: > considering this model: > > class Inventory (models.Model): >id = models.AutoField (primary_key=True) >Barcode = models.BigIntegerField(blank=False) >Location = models.CharField

help with foreign keys in admin

2011-02-02 Thread Bobby Roberts
considering this model: class Inventory (models.Model): id = models.AutoField (primary_key=True) Barcode = models.BigIntegerField(blank=False) Location = models.CharField (max_length=25,blank=False, db_index=True) Sku = models.CharField (max_length=25,blank=False,

Re: Amazing work

2011-02-02 Thread km
On Thu, Feb 3, 2011 at 8:18 AM, Kenneth Gonsalves wrote: > On Wed, 2011-02-02 at 08:56 -0600, Jon J wrote: > > I just stumbled upon django when looking for a good way to use Python > > in web programming, > > welcome to the club - btw, how did you manage to avoid stumbling

Re: Amazing work

2011-02-02 Thread Kenneth Gonsalves
On Wed, 2011-02-02 at 08:56 -0600, Jon J wrote: > I just stumbled upon django when looking for a good way to use Python > in web programming, welcome to the club - btw, how did you manage to avoid stumbling over django all these years? -- regards KG http://lawgon.livejournal.com Coimbatore LUG

Re: django advent for 1.3

2011-02-02 Thread Steve Holden
:-) -- 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 this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group

Re: django advent for 1.3

2011-02-02 Thread Idan Gazit
Hey folks, Though the hour's getting late with tempers growing quite irate your patience growing thin and weary as you issue forth a query: where is Django Advent? Though we struggle, work and try sometimes authors don't comply they plead their overscheduled life their kids, their gardens, and

Job in Newcastle NSW

2011-02-02 Thread Peter Williams
Hi all The RDN seeks a PROGRAMMER/SYSTEMS ENGINEER for 12 months to be based in our Head Office in Newcastle’s CBD. This position will provide essential programming services to the Information Management team utilising high-level development languages and libraries such as SQL, HTML, Django,

Modifying form values before redirect

2011-02-02 Thread Osiaq
Hi all! I'm receiving the form from index.html and redirecting to order.html I would like to change "customer" value before redirection. When I try to modify it, Im getting "object does not support item assignment" How can I change "customer" value posted from index.html ? Thank you!

Re: Loose Coupling? Dependencies for "forms" and "db".

2011-02-02 Thread Russell Keith-Magee
On Thu, Feb 3, 2011 at 1:47 AM, bluesolver wrote: > I don't know if I will actually fork the project, but I am getting to > the point where I am maintaining multiple sites.  So I'm seeing a lot > of duplicate code between different sites of mine.  I guess this is >

Re: working django with existing database

2011-02-02 Thread arief nur andono
finally I got the answer... http://www.sqlalchemy.org/trac/wiki/SqlSoup http://spyced.blogspot.com/2006/04/introducing-sqlsoup.html from sqlalchemy.ext.sqlsoup import SqlSoup db = SqlSoup('oracle://z:z@xe') rp = db.bind.execute('select * from mupp') a = rp.fetchall() a[0].kodeupp

Re: Debugging Why CSS File Will Not Load

2011-02-02 Thread octopusgrabbus
Thanks. I was trying to hide the port. They're all the same for real, 8082. On Feb 2, 2:21 pm, Eric Chamberlain wrote: > Your port numbers don't match. > > What does Firebug or some other html debug tool say about the file? > > On Feb 2, 2011, at 10:55 AM, octopusgrabbus wrote: > >

Re: Debugging Why CSS File Will Not Load

2011-02-02 Thread Jon J
Firebug is a great tool for diagnosing problems like this, and Chromium has even better functionality built in! This problem is being caused by an improper configuration setting, IMO. Also, the preferred method of deployment is to use the same virtual host and create an Alias directive for

JOB: Security Technical Lead/Senior Developer with Django needed at CISCO

2011-02-02 Thread brero...@cisco.com
Please contact Brent at brero...@cisco.com if you are interested in the job opening listed below. Security Technical Lead/Senior Developer Location – San Jose, California Job Description: The Security Technology Business Unit (STBU) within Cisco is seeking a Technical lead/owner for its

Re: django advent for 1.3

2011-02-02 Thread SlafS
OK. Thanks. I agree that the number of new features isn't as big as in the 1.2 release and maybe there is no sense for another series before this one. Although I would love to see an expert article about class based views. I'm Little bit confused about it right now. Cheers On 2 Lut, 20:28, Dan

Re: Using custom / Extending default Request Object

2011-02-02 Thread Tereska
Thanks that's gr8! On 2 Lut, 21:52, Daniel Roseman wrote: > On Wednesday, February 2, 2011 8:38:58 PM UTC, Tereska wrote: > > > My RequestObject must contain information about user device (mobile, > > tablets etc) with device capatibilites (resolution, video codecs > >

Re: Using custom / Extending default Request Object

2011-02-02 Thread Daniel Roseman
On Wednesday, February 2, 2011 8:38:58 PM UTC, Tereska wrote: > > My RequestObject must contain information about user device (mobile, > tablets etc) with device capatibilites (resolution, video codecs > etc) . > It's a data collection not simple string. Then I want use it in views > and

Re: Using custom / Extending default Request Object

2011-02-02 Thread Tereska
My RequestObject must contain information about user device (mobile, tablets etc) with device capatibilites (resolution, video codecs etc) . It's a data collection not simple string. Then I want use it in views and templates. On Feb 2, 9:27 pm, Daniel Roseman wrote: > On

Re: Using custom / Extending default Request Object

2011-02-02 Thread Daniel Roseman
On Wednesday, February 2, 2011 8:12:30 PM UTC, Tereska wrote: > > I have to extend HttpRequest class and be able to use it in views > (request argument in each view must be instance of MyHttpRequest > class) > > How to do that? (without extending BaseHandler) > > Why do you need to do this?

Using custom / Extending default Request Object

2011-02-02 Thread Tereska
I have to extend HttpRequest class and be able to use it in views (request argument in each view must be instance of MyHttpRequest class) How to do that? (without extending BaseHandler) -- You received this message because you are subscribed to the Google Groups "Django users" group. To post

Re: variable column name

2011-02-02 Thread bruno desthuilliers
On 2 fév, 20:48, Tony wrote: > for example, > I have t = 'bar' and foo = modelName.objects.get(id = 4) > I want to do something like: > foo.t = "new value" or foo[t] = "new value" (but those dont work). setattr(foo, t, "new value") -- You received this message because you

variable column name

2011-02-02 Thread Tony
If I return a string variable from a template to a view function, and the string variable is the name of a model (so I dont know which one it is) in a known class for a known object in the database, is there anyway I can change the data for that column without doing a bunch of if statements trying

Re: django advent for 1.3

2011-02-02 Thread Dan Carroll
Not sure. I really enjoyed the 1.2 series of articles, but I'm not sure if they could even do something as big for the 1.3 release. This release is mostly bug fixes, with a few big changes (static files, class-based generic views, and logging). With the 1.3 release due by the end of February, if

Re: Debugging Why CSS File Will Not Load

2011-02-02 Thread Eric Chamberlain
Your port numbers don't match. What does Firebug or some other html debug tool say about the file? On Feb 2, 2011, at 10:55 AM, octopusgrabbus wrote: > I am trying to load static content (one css file) from the same apache > server, using a different virtual host. I have no errors, but the

Re: using return upper

2011-02-02 Thread makayabou
Hello, I found a solution for the simplified version of my problem. In models.py, I use: def __unicode__(self): oses_installed = u','.join(self.operatingsystemused.all().values_list('operatingsystem', flat=True)) return ("%s" % (oses_installed)) However,

Debugging Why CSS File Will Not Load

2011-02-02 Thread octopusgrabbus
I am trying to load static content (one css file) from the same apache server, using a different virtual host. I have no errors, but the css file appears not to load. How can I debug this further? The load shows up in /var/log/apache2/other_vhosts_access.log: Here are settings from httpd.conf.

Re: Posible Django Admin BUG

2011-02-02 Thread Jorge Kleinerman (WindBack)
Thanks Ramiro, The filter() call was wrong. I removed it and now it is rendering fine The curious thing is that in 1.1 it was working fine. However, thanks a lot Regards -Jorge On Feb 2, 1:31 pm, Ramiro Morales wrote: > On Wed, Feb 2, 2011 at 1:08 PM, Ramiro Morales

template and layout design using axure

2011-02-02 Thread bedros
Any body here tried axure for template design; it's little pricey; and I wonder if it's worth the price http://www.axure.com/ Thanks, Bedros -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Loose Coupling? Dependencies for "forms" and "db".

2011-02-02 Thread bluesolver
It's true I've seen Django-nonrel, however it is unappealing to me primarily, because it just tries to hook into Django's current ORM, which I'm not crazy about. Further than that, I don't know that I want to create "Models" that are hard coded. Why add type checking to a database that doesn't

Re: Add/Remove fields in ModelForm in Admin site

2011-02-02 Thread andmart
Finally , I got it. class ItemForm(ModelForm): item = forms.CharField(label='Item') class Meta: model=Item def __init__(self, *args, **kwargs): super(ItemForm, self).__init__(*args, **kwargs) if kwargs.has_key('instance'): del self.fields['item']

Re: inserting inlines to an specific admin class affects all of them

2011-02-02 Thread Marc Aymerich
On Wed, Feb 2, 2011 at 5:39 PM, Marc Aymerich wrote: > On Wed, Feb 2, 2011 at 5:19 PM, Daniel Roseman wrote: >> On Wednesday, February 2, 2011 4:00:34 PM UTC, Marc Aymerich wrote: >>> >>> Hi! >>> I have a plugin style app that adds "support" for PHP

Re: inserting inlines to an specific admin class affects all of them

2011-02-02 Thread Marc Aymerich
On Wed, Feb 2, 2011 at 5:19 PM, Daniel Roseman wrote: > On Wednesday, February 2, 2011 4:00:34 PM UTC, Marc Aymerich wrote: >> >> Hi! >> I have a plugin style app that adds "support" for PHP (inserting two >> admin inlines) into VirtualHostAdmin class, I use this code for

Re: Posible Django Admin BUG

2011-02-02 Thread Ramiro Morales
On Wed, Feb 2, 2011 at 1:08 PM, Ramiro Morales wrote: > On Wed, Feb 2, 2011 at 12:59 PM, Jorge Kleinerman (WindBack) > wrote: >> Thanks >> >> I will try to post it there > > I'd suggest to do some homework first: > > Create a clon of your application and

Re: inserting inlines to an specific admin class affects all of them

2011-02-02 Thread Daniel Roseman
On Wednesday, February 2, 2011 4:00:34 PM UTC, Marc Aymerich wrote: > > Hi! > I have a plugin style app that adds "support" for PHP (inserting two > admin inlines) into VirtualHostAdmin class, I use this code for the > job: > > admin.site.unregister(VirtualHost) > ix =

Re: Posible Django Admin BUG

2011-02-02 Thread Ramiro Morales
On Wed, Feb 2, 2011 at 12:59 PM, Jorge Kleinerman (WindBack) wrote: > Thanks > > I will try to post it there I'd suggest to do some homework first: Create a clon of your application and start removing models and fields from models. Same thing for the admin.py code

inserting inlines to an specific admin class affects all of them

2011-02-02 Thread Marc Aymerich
Hi! I have a plugin style app that adds "support" for PHP (inserting two admin inlines) into VirtualHostAdmin class, I use this code for the job: admin.site.unregister(VirtualHost) ix = len(VirtualHostAdmin.inlines) VirtualHostAdmin.inlines.insert(ix, PHPVersionInline)

Re: Posible Django Admin BUG

2011-02-02 Thread Jorge Kleinerman (WindBack)
Thanks I will try to post it there On Feb 2, 11:43 am, Casey Greene wrote: > Hi Jorge, > > The Django code repository and bug report system is > here:http://code.djangoproject.com/ > > Hope this helps, > Casey > > On 02/02/2011 09:30 AM, Jorge Kleinerman (WindBack)

Re: django OneToOne field may not be NULL

2011-02-02 Thread Tom Evans
On Wed, Feb 2, 2011 at 3:26 PM, gintare wrote: > Hello, > > I would like to ask how i should correctly deal with OneToOne (OTO) > relation field . > When i create object from model with OTO fields i do not want to > assign any model to them. Maybe i will do in future when

django OneToOne field may not be NULL

2011-02-02 Thread gintare
Hello, I would like to ask how i should correctly deal with OneToOne (OTO) relation field . When i create object from model with OTO fields i do not want to assign any model to them. Maybe i will do in future when appropriate object will appear. Django do not let me to have not assigned OTO

Re: method being called twice?

2011-02-02 Thread Daniel Roseman
On Wednesday, February 2, 2011 2:27:16 PM UTC, Burhan wrote: > > Hello, I have a strange problem which I am unable to figure out. > > I have a method that is POSTed some information from a third-party > payment gateway. The request is sent to payment-result.jsp? > PaymentID=342 (where 342 is

Re: Django Project - handling call to the "root" url?

2011-02-02 Thread Tom Evans
On Wed, Feb 2, 2011 at 3:08 PM, Derek wrote: > Thanks Tom - I will try that and report back. > (Sidebar: usually when people report issues here, the first response is > "show me the code".  I thought I would start with the code ... and the > response has been "tell me the

Re: Django Project - handling call to the "root" url?

2011-02-02 Thread Derek
Thanks Tom - I will try that and report back. (Sidebar: usually when people report issues here, the first response is "show me the code". I thought I would start with the code ... and the response has been "tell me the requirements" ... so it goes, I guess!) On 2 February 2011 16:51, Tom Evans

Amazing work

2011-02-02 Thread Jon J
I just stumbled upon django when looking for a good way to use Python in web programming, and I must say, I'm extremely impressed. I have dabbled in other frameworks such as Ruby on Rails but deemed it wasn't worth the time because frankly, RoR throws a bunch of nonsensical terms at you (rails,

Re: Django Project - handling call to the "root" url?

2011-02-02 Thread Tom Evans
On Wed, Feb 2, 2011 at 2:35 PM, Derek wrote: > Tom > Restated thusly: > 1. I want the "/" to display the login form (and not append 'admin/' to the > visible URL) > 2. I want the login form (which I have coded) to work as normal > 3. I want the rest of admin to work with the

Re: Loose Coupling? Dependencies for "forms" and "db".

2011-02-02 Thread Masklinn
On 2011-02-02, at 14:45 , bluesolver wrote: > I have decided that I need considerably more control over both my HTML and my database, which in point of fact is being moved from Postgresql to MongoDB. DB sure, but last time I checked django never took *any* control of my HTML (unless I

Re: Posible Django Admin BUG

2011-02-02 Thread Casey Greene
Hi Jorge, The Django code repository and bug report system is here: http://code.djangoproject.com/ Hope this helps, Casey On 02/02/2011 09:30 AM, Jorge Kleinerman (WindBack) wrote: With the last Django 1.2 I have the following problem trying to render the admin interface: Exception Value:

Re: method being called twice?

2011-02-02 Thread Tom Evans
On Wed, Feb 2, 2011 at 2:27 PM, Burhan wrote: > Hello, I have a strange problem which I am unable to figure out. > > I have a method that is POSTed some information from a third-party > payment gateway. The request is sent to payment-result.jsp? > PaymentID=342 (where 342

Re: Django Project - handling call to the "root" url?

2011-02-02 Thread Casey S. Greene
Hi Derek, When people log in, what do you want to happen? Do you want them to reach the admin interface or some other page? -- Casey On 02/02/2011 09:35 AM, Derek wrote: Tom Restated thusly: 1. I want the "/" to display the login form (and not append 'admin/' to the visible URL) 2. I want

Re: Django Project - handling call to the "root" url?

2011-02-02 Thread Derek
Tom Restated thusly: 1. I want the "/" to display the login form (and not append 'admin/' to the visible URL) 2. I want the login form (which I have coded) to work as normal 3. I want the rest of admin to work with the 'admin/' portion (prepended as normal) I am not sure how else to describe

Posible Django Admin BUG

2011-02-02 Thread Jorge Kleinerman (WindBack)
With the last Django 1.2 I have the following problem trying to render the admin interface: Exception Value: Caught ValueError while rendering: invalid literal for int() with base 10: 'psi102'. I didn't have this problem in a previous version of django. This is my models.py:

Re: method being called twice?

2011-02-02 Thread Karen Tracey
On Wed, Feb 2, 2011 at 9:27 AM, Burhan wrote: > # various other calls, which redirect to a template I think you need to be a little more specific about what exactly is done there for anyone to be able to provide useful help on this one. Karen --

Re: cascading create

2011-02-02 Thread Derek
Phlip There are a number of posts discussing this issue - one of them may give you some pointers: http://stackoverflow.com/questions/1136106/efficent-way-to-insert-thousands-of-records-into-a-table-sqlite-python-django

method being called twice?

2011-02-02 Thread Burhan
Hello, I have a strange problem which I am unable to figure out. I have a method that is POSTed some information from a third-party payment gateway. The request is sent to payment-result.jsp? PaymentID=342 (where 342 is any integer). My URL pattern is: (r'^payment-result.jsp$', result) The

Re: Django Project - handling call to the "root" url?

2011-02-02 Thread Tom Evans
On Wed, Feb 2, 2011 at 2:12 PM, Derek wrote: > Tracey > > Thanks - that is a neat idea... but I only need it for that one page. > I want the rest of the (protected) admin pages to work as normal. > > Derek > You probably need to re-state your problem, as it is unclear what

Re: Django Project - handling call to the "root" url?

2011-02-02 Thread Derek
I am not sure I understand your reply. I don't want a @login_required check for the root view - its just a simple HTML page for users to login. On Feb 2, 12:37 pm, Xavier Ordoquy wrote: > Hi, > > > However, when I alter the root() function to: > > > def root(request): > >  

Re: Django Project - handling call to the "root" url?

2011-02-02 Thread Derek
Tracey Thanks - that is a neat idea... but I only need it for that one page. I want the rest of the (protected) admin pages to work as normal. Derek On Feb 2, 2:02 pm, Karen Tracey wrote: > On Wed, Feb 2, 2011 at 5:24 AM, Derek wrote: > > I need to

Re: Django Project - handling call to the "root" url?

2011-02-02 Thread Karen Tracey
On Wed, Feb 2, 2011 at 5:24 AM, Derek wrote: > I need to handle a call to the root url for a site more elegantly than my > current. > > At the moment I have: > > #urls.py > (r'^$', 'myproj.myapp.views.root'), > #and > (r'^admin/', include(admin.site.urls)), > >

RE: Adding popups for edit

2011-02-02 Thread Chris Matthews
Hi Marco, Again the book "Django JavaScript Integration: AJAX and jQuery" by Jonathan Hayward. In Chapter 6 he covers jQuery In-place editing by using http://www.appelsiini.net/projects/jeditable PS: I have never met Jonathan, I live far-away in Africa, so I am not plugging his book. I happen

RE: Filtered drop down choice django

2011-02-02 Thread Chris Matthews
Hi Sushanth, I am currently working through the book "Django JavaScript Integration: AJAX and jQuery" by Jonathan Hayward. In Chapter 7 he covers autocomplete (see http://jqueryui.com/ or more specifically http://jqueryui.com/demos/autocomplete/) to handle filtered drop down. From:

Adding popups for edit

2011-02-02 Thread Dekker
Hi Django Admin includes Popups for adding (FK) records by clicking the "+"-image next to the foreign key. I would like to add an "edit"-button, that would allow for a popup to edit the currently selected entry. Can I "copy" the behaviour of the "+"-image (showAddAnotherPopup and

Re: Django Project - handling call to the "root" url?

2011-02-02 Thread Xavier Ordoquy
Hi, > However, when I alter the root() function to: > > def root(request): > return render_to_response('admin/login.html', None) > > This causes a loop condition i.e. displays the page OK, but trying to login > just redisplays the page... any ideas how to make this work as intended? >

Django Project - handling call to the "root" url?

2011-02-02 Thread Derek
I need to handle a call to the root url for a site more elegantly than my current. At the moment I have: #urls.py (r'^$', 'myproj.myapp.views.root'), #and (r'^admin/', include(admin.site.urls)), #views.py def root(request): """Handle a call to the / (root) URL address"""

Re: Filtered drop down choice django

2011-02-02 Thread Andre Terra
Patches are welcome! On Wed, Feb 2, 2011 at 07:48, Derek wrote: > I suspect I am not the only one really hoping for An Official Way to > be developed at some time... > > In the meantime, also look at: >

Re: Filtered drop down choice django

2011-02-02 Thread Derek
I suspect I am not the only one really hoping for An Official Way to be developed at some time... In the meantime, also look at: http://www.stereoplex.com/blog/filtering-dropdown-lists-in-the-django-admin I think this is quite detailed and has some good comments as well. On Feb 1, 7:07 pm,

Re: Model Forms Customization

2011-02-02 Thread Derek
The same question was asked on stackoverflow: http://stackoverflow.com/questions/2303268/djangos-forms-form-vs-forms-modelform Its a good explanation - I liked the bit at the end: "The similarities are that they both generate sets of form inputs using widgets, and both validate data sent by the

Re: Django model object allocation performance

2011-02-02 Thread Thomas Weholt
I might be missing something here, but in the first example you do: len(list(m)) and the next example you do: len(list(m.values())) As far as I know, calling .values() will bypass the creation of Django ORM objects and just return a dictionary for each record instead of a model instance. This

Re: Django model object allocation performance

2011-02-02 Thread Daniel Roseman
On Tuesday, February 1, 2011 11:52:49 PM UTC, oyiptong wrote: > > Hello, > > I have been seeing a big performance degradation with my application > in production. > The traffic is roughly 2.5K pageviews per day. I can expect each page > to load 100 model objects in memory. > > Some might

django advent for 1.3

2011-02-02 Thread SlafS
Hi there! Is there going to be an advent article series for a 1.3 release? Regards Sławek -- 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 this group,

Re: Django, Postgres and recovering from database constraints

2011-02-02 Thread Xavier Ordoquy
ok, thanks a lot. savepoints saved my day :p It just worked out of the box while the other methods didn't seem to work. Back on a more serious topic, could someone confirm or not that the transaction rollback (http://docs.djangoproject.com/en/1.2/topics/db/transactions/#transaction-rollback)