Re: changing how an admin form field is displayed (float to datetime)

2009-10-26 Thread Paul Smith
Paul Smith catugmt.com> writes: > > I’ve been trying to a modify an admin form so I have a slightly different > user interface compared to the database model. > > The main problem is this; in the database model I store a start and end > time as timestamps (a float holding seconds since 1/1/197

Re: Behaviour of related objects

2009-10-26 Thread Bojan Mihelac
On Oct 26, 5:22 am, Preston Holmes wrote: > On Oct 25, 2:55 pm, Bojan Mihelac wrote: > > > Hi all, > > > given an many_to_one doctests with Reporter/Article models, the > > following example would fail with "IntegrityError: > > many_to_one_article.reporter_id may not be NULL": > > > >>> r = Re

Re: ANN - Satchmo 0.9 Released

2009-10-26 Thread Renato Francisco G. Amaral
Great news! Congrats, Cris. I intend to use Satchmo in my next project. Renato Amaral 2009/10/25 Chris Moffitt > I am very happy to announce that Satchmo 0.9 is now released. > > Satchmo is an ecommerce framework built on the Django framework. It is > designed to be robust and full featured o

Django-cms

2009-10-26 Thread aju mathew
Hi In Django CMS any blog plugin is available. -- Thanks & Regards, Aju P Mathew --~--~-~--~~~---~--~~ 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@googlegroup

Re: Django-cms

2009-10-26 Thread David Zhou
On Mon, Oct 26, 2009 at 4:16 AM, aju mathew wrote > > In Django CMS any blog plugin is available. You should be using the Django-CMS mailing list for this in the future. That said, use CMS_PLACEHOLDER_CONF to specify which plugins are available for which placeholders: http://www.django-cms.org

Re: AttributeError when trying to run syncdb after installing django-friends

2009-10-26 Thread Gezim Hoxha
Actually it was an error with the app itself and it had been corrected in a newer version. Thanks :) On Oct 17, 10:37 pm, Prashanth wrote: > Hi Gezim, > > On Sun, Oct 18, 2009 at 7:58 AM, Gezim Hoxha wrote: > > I also added "friends" to the INSTALLED_APPS. > > That all went fine. However runni

MultipleForm factory and optional forms

2009-10-26 Thread Norbert Wójtowicz
I've borrowed Alex Gaynor's code for building MultipleForm factories [0] and updated it to work with optional form fields. The idea comes from the following situation: you have a profile page with many services (eg. blip, twitter, etc) that you link to via ForeignKey. class MicroBlog(models.Mode

Db migration

2009-10-26 Thread aju mathew
Hi How can I populate values from a python file to database. Is it any commands their for db migration from command prompt. -- Thanks & Regards, Aju P Mathew --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django

Re: Db migration

2009-10-26 Thread Daniel Roseman
On Oct 26, 10:39 am, aju mathew wrote: > Hi > > How can I populate values from a python file to database. > > Is it any commands their for db migration from command prompt. > > -- > Thanks & Regards, > Aju P Mathew What do you mean a 'Python file'? If it's in a Python file, you can use ORM comma

Re: ModelForm - how to post primary key to update existing record?

2009-10-26 Thread Daniel Roseman
On Oct 26, 5:19 am, robinne wrote: > I am noticing that when I load an existing ModelForm into a template, > and I save (POST), I can't seem to get the primary key back in order > to update that specific record. I am starting to head down the path of > formsets...but that is not what I need. I am

Re: Model design

2009-10-26 Thread Vinicius Mendes | meiocodigo.com
def __unicode__(self): return unicode(self.place)+' - '+self.nome On Oct 25, 8:47 pm, Caisys wrote: > Thanks but I am not very familiar with forms yet I barely managed to > override the default form. > However, I thought that its ok for the time being since places and > subplaces are not cha

Re: Db migration

2009-10-26 Thread Tom Evans
On Mon, 2009-10-26 at 16:09 +0530, aju mathew wrote: > Hi > > How can I populate values from a python file to database. > > Is it any commands their for db migration from command prompt. > > -- > Thanks & Regards, > Aju P Mathew > http://docs.djangoproject.com/en/dev/howto/initial-data/ Che

Re: Model design

2009-10-26 Thread Daniel Roseman
On Oct 25, 11:47 pm, Caisys wrote: > Thanks but I am not very familiar with forms yet I barely managed to > override the default form. > However, I thought that its ok for the time being since places and > subplaces are not changed frequently so i can live with it for the > time being and move to

Starting a daemon thread from Django view

2009-10-26 Thread dim
I am writing a service that should handle HTTP requests according to following scenario: - register a job - make an "ok" response - do the job - report the job is complete by making HTTP request to other service The jobs are often lightweight and will be executed very quickly so I don't want to

inspectdb Oracle

2009-10-26 Thread gillengam
Hi, I must develop an application that use Oracle database. The Oracle connection user is the owner of some tables, but he can only read two views (he is not the owner). I used command "python manage.py inspectdb > models.py", but I got only user's tables and I need also the two views. How ca

Troubleshoot import errors

2009-10-26 Thread Dave
Hi All, I admit I must totally be missing something. My problem is that IF I screw up an import somewhere tracking down the problem is a complete nightmare. The traceback just tells me: "NoReverseMatch: Reverse for 'view_picture' with arguments '()' and keyword arguments '{'picture_id': '', 'size

Re: inspectdb Oracle

2009-10-26 Thread Jani Tiainen
gillengam kirjoitti: > Hi, I must develop an application that use Oracle database. The Oracle > connection user is the owner of some tables, but he can only read two > views (he is not the owner). I used command "python manage.py > inspectdb > models.py", but I got only user's tables and I ne

Redirects on HTTPS

2009-10-26 Thread Tim Sawyer
I still can't get this to work (original thread at http://groups.google.com/group/django-users/browse_thread/thread/cdece5ef2e7fd280). I'm looking to get a HttpResponseRedirect in my django app to redirect to HTTPS not HTTP. I've tried: * proxy server Apache (the one doing the SSL) does: SetEnv

Re: Do reverse relations eventually kill performance?

2009-10-26 Thread Manfre
Subclass Manager and make this the default manager for all owner restricted models. Override filter() and get() to check for the "owner" arg. Raise an error if it is not specified. Also set use_for_related_fields = True for the manager to cover the reverse relations. Regards, Michael On Oct 25,

Django templates, break a for after an if

2009-10-26 Thread NMarcu
Hello all, I want to do something like this: {% for u in users %} {% for su in superu %} {% ifequal u su %} //do something end exit from this for {% endifequal %} {% endfor %} {% endfor %} How can I do

Re: Django templates, break a for after an if

2009-10-26 Thread Jani Tiainen
NMarcu kirjoitti: > Hello all, > >I want to do something like this: > > {% for u in users %} > {% for su in superu %} > {% ifequal u su %} >//do something end exit > from this for > {% endifequal %} > {%

Re: inspectdb Oracle

2009-10-26 Thread Mark (Nosrednakram)
On Oct 26, 4:43 am, gillengam wrote: > Hi, I must develop an application that use Oracle database. The Oracle > connection user is the owner of some tables, but he can only read two > views (he is not the owner). I used command "python manage.py > inspectdb > models.py", but I got only user's tab

Re: Django templates, break a for after an if

2009-10-26 Thread Tom Evans
On Mon, 2009-10-26 at 15:54 +0200, Jani Tiainen wrote: > NMarcu kirjoitti: > > Hello all, > > > >I want to do something like this: > > > > {% for u in users %} > > {% for su in superu %} > > {% ifequal u su %} > >//do someth

Re: Troubleshoot import errors

2009-10-26 Thread Hector Garcia
Check out all your template calls to {% url view_picture %}, you are probably passing wrong arguments to the reverse URL. Hector Garcia - Web developer, musician http://nomadblue.com/ On Mon, Oct 26, 2009 at 12:37 PM, Dave wrote: > > Hi All, I admit I must totally be missing something. My pr

Resizing and renaming images in 'save' method

2009-10-26 Thread virhilo
How to correctly resize and rename upladed image in 'save' method? # Here is our model: class Product(models.Model): # some fields photo = models.ImageField(upload_to='images', verbose_name=u'zdjęcie', null=True, blank=True) # and here we are our save method: def save(self, *args, **

Truth values for current database type for custom queries.

2009-10-26 Thread Bill Freeman
I have a query that is complex enough that, even if it can be done with filter, exclude, and Qs, I find more maintainable as custom SQL. That all works fine. But I want to add the test of a boolean field in my WHERE clause, and different databases represent true and false differently. Specificall

ajax problem

2009-10-26 Thread elminio
Hello, The situation is that I have a div to which I want to dynamically load forms for update create etc of my models. I use generic forms. And the problem is that when I use javascript with jQuery : key is already defined: $("#div_nontetn").load("/model/"+ key + "/update/", {object_id: key}

Re: Definitive solution for foreignkey filtering in Admin

2009-10-26 Thread Tim Valenta
Many many thanks for the response. I had tried that approach, but had no idea what was coming through in kwargs. I feel like 'kwargs' on most class objects needs more thorough documentation for the general users who refer primarily to the on-site docs. Even digging through some code, I simply h

Re: Design decision

2009-10-26 Thread Léon Dignòn
*bump* On 23 Okt., 11:03, Léon Dignòn wrote: > callerlist will MAYBE use a database of another program (not django), > or it uses a database of another django application. This is optional > and I want callerlist to work with or without. For that i decided to > create an application customerlist

static models methods

2009-10-26 Thread Alessandro Ronchi
I need to create a static method for a model class like this. The line Settore.objects.all()[0].id gives error ( psycopg2.InternalError: current transaction is aborted) when creating the tables at first syncdb. What's the correct way to do that? ~ class Settore(models.Mod

Re: static models methods

2009-10-26 Thread Ethan Jucovy
I don't know what the error means, but this looks like the sort of thing you might want to put on a custom Manager instead -- then you could say `Settore.objects.get_default()`. http://docs.djangoproject.com/en/dev/topics/db/managers/#topics-db-managers (I have a feeling the error wouldn't happe

Adding button to admin change form

2009-10-26 Thread Aaron
I need to add a button to the admin change form of certain models, which would be placed among the save buttons. I've tried overriding the template submit_line.html, but I am coming under the impression that this is not possible unless I override the template for my entire project. I need this bu

Re: Url params with space

2009-10-26 Thread Sumanth
Thanks That works neat On Oct 23, 9:53 am, Andrius A wrote: > Hi Sumanth, > > Yes we do. Use urlib.unquote_plus() > > Regards, > Andrius > > On 23 Oct 2009 17:14, "Sumanth" wrote: > > Hi All, > > I have url as show below > > http://localhost:8000/view/1/1/?scenario=Base,%20Credit > > now when

Re: static models methods

2009-10-26 Thread Bill Freeman
I have to wonder whether "get_default" is a name that already means something to Django. On Mon, Oct 26, 2009 at 12:22 PM, Alessandro Ronchi wrote: > > I need to create a static method for a model class like this. The line > Settore.objects.all()[0].id gives error  ( > psycopg2.InternalError: cu

Re: static models methods

2009-10-26 Thread Daniel Roseman
On Oct 26, 4:22 pm, Alessandro Ronchi wrote: > I need to create a static method for a model class like this. The line > Settore.objects.all()[0].id gives error  ( > psycopg2.InternalError: current transaction is aborted) when creating > the tables at first syncdb. What's the correct way to do tha

Re: ModelForm - how to post primary key to update existing record?

2009-10-26 Thread robinne
I pass Member to the template with something like this...(I don't have my code here with me) VIEW ... if not post member = MemberModel(pk=1) return render_to_response('mytemplate.html', {'Member':member}) Basically, I am providing a Member (ModelForm) to the template. What you gave me here

DATE_FORMAT

2009-10-26 Thread Sumanth
Hi all, Currently the DATE_FORMAT is used only for admin pages. Can I use similar setting where all my date objects are displayed in the same way in templates , without having to apply humanize on templates not using date function in templates? Thanks Sumanth --~--~-~--~~

Admin interface is doing nothing

2009-10-26 Thread M.
Hi, I've installed the Admin interface, but the interface is unresponsive. If click on USERS, the page refreshes itself and appends auth/user/ to the URL. If I click it again, it appends it again, but I still remain on the same page. I am using Python 2.6 and Ubuntu. Thanks, Martynas --~--~

Re: Admin interface is doing nothing

2009-10-26 Thread Mikhail Korobov
It is very likely that your urls.py is wrong. Re-check if admin urls are included exactly as in documentation example: "(r'^admin/', include (admin.site.urls))", without any wildcards. On 27 окт, 00:12, "M." wrote: > Hi, > > I've installed the Admin interface, but the interface is unresponsive.

Re: Adding button to admin change form

2009-10-26 Thread Mikhail Korobov
You should override change_form.html template and save it as /your_project/templates/admin/your_app/change_form.html or /your_project/templates/admin/your_app/your_model/change_form.html On 26 окт, 21:45, Aaron wrote: > I need to add a button to the admin change form of certain models, > whic

Download Free Softwares,Games,Music,Wallpapers,Movies,Dvd movies,bluray movies, hd wallpapers

2009-10-26 Thread Usman Haider
Visit http://www.ReDown.Com for Cracked Softwares,Games,Wallpapers,Music,Movies,Seasons,Bluray Movies,HD wallpapers. www.ReDown.Com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to thi

Re: Definitive solution for foreignkey filtering in Admin

2009-10-26 Thread Tim Valenta
> forms.ModelForm.__init__(self, *args, **kwargs) > location = kwargs.get('instance', None) > if location: > self.fields['contract'].queryset = Contract.objects.filter > (company=location.company) It seems that editing the values in self.fields yields rendering

Re: Admin interface is doing nothing

2009-10-26 Thread M.
Yes, you were right. I copied some of the code from my other project, which was writen with Django 1.0 and my URL contained .* in the end. Thank you for your help. On Oct 26, 10:02 pm, Mikhail Korobov wrote: > It is very likely that your urls.py is wrong. Re-check if admin urls > are included e

Unit testing form validation issue

2009-10-26 Thread Chris Allen
Anyone have any experience with forms (ModelMultipleChoice fields and foreignkey'd choice fields) not validating properly in a unit test but just fine in the runserver? Passing the same request.POST data to the unit test as I am in the runserver and live instance, which I verified via the debugge

Re: Unit testing form validation issue

2009-10-26 Thread Karen Tracey
On Mon, Oct 26, 2009 at 4:12 PM, Chris Allen wrote: > > Anyone have any experience with forms (ModelMultipleChoice fields and > foreignkey'd choice fields) not validating properly in a unit test but > just fine in the runserver? > > Passing the same request.POST data to the unit test as I am in t

syntax error what am i doing wrong???

2009-10-26 Thread jon...@cox.net
SyntaxError at / ('invalid syntax', ('c:\\Users\\Vincent\\Documents\\django_bookmarks\ \..\\django_bookmarks\\bookmarks\\views.py', 15, 20, 'return Http Response(output)\n')) SCRIPT FROM VIEWS.PY from django.http import HttpResponse def main_page(request) : output = ''' %s

View count ignore auto_now

2009-10-26 Thread TheIvIaxx
Hello, I have a simple page model that has created and modified fields with auto_add and auto_now set to True. I'd like to keep track of the number of views per page so i added a views field to the model. However if i increment the views and save, then the modified gets changed. This trivializes

Re: syntax error what am i doing wrong???

2009-10-26 Thread Antoni Aloy
2009/10/26 jon...@cox.net : > > SyntaxError at / > > ('invalid syntax', ('c:\\Users\\Vincent\\Documents\\django_bookmarks\ > \..\\django_bookmarks\\bookmarks\\views.py', 15, 20, 'return Http > Response(output)\n')) > > SCRIPT FROM VIEWS.PY > > from django.http import HttpResponse > def main_page(r

Re: syntax error what am i doing wrong???

2009-10-26 Thread Daniel Roseman
On Oct 26, 10:35 pm, "jon...@cox.net" wrote: > SyntaxError at / > > ('invalid syntax', ('c:\\Users\\Vincent\\Documents\\django_bookmarks\ > \..\\django_bookmarks\\bookmarks\\views.py', 15, 20, 'return Http > Response(output)\n')) > > SCRIPT FROM VIEWS.PY > > from django.http import HttpResponse >

RE: syntax error what am i doing wrong???

2009-10-26 Thread Vincent Jones
Thanks...it worked. -Original Message- From: django-users@googlegroups.com [mailto:django-us...@googlegroups.com] On Behalf Of Daniel Roseman Sent: Monday, October 26, 2009 7:01 PM To: Django users Subject: Re: syntax error what am i doing wrong??? On Oct 26, 10:35 pm, "jon...@cox.net"

Discovering the ip/port in use by runserver

2009-10-26 Thread tow
If you're running your django server through ./manage.py runserver, is there a way, from within the django process, to discover which IP address and port are in use? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "D

session question

2009-10-26 Thread webbo
Hi all, It's great to join this great Django place !! I am trying to make session work, but it doesn't work as I think. I want my 2 pages able to share the same variables that I stored in session. Thanks first for paying attention on this post. Please give me some suggestion as bellow: I w

Re: Discovering the ip/port in use by runserver

2009-10-26 Thread tow
Other than something like this, obviously, which works, but is a bit fragile & certainly not very nice: def get_server_address_by_stack_inspection(): import inspect for s in inspect.stack(): if (s[0].f_code.co_filename.endswith("django/core/ servers

Re: View count ignore auto_now

2009-10-26 Thread Matt Schinckel
On Oct 27, 8:56 am, TheIvIaxx wrote: > Hello, I have a simple page model that has created and modified fields > with auto_add and auto_now set to True.  I'd like to keep track of the > number of views per page so i added a views field to the model. > However if i increment the views and save, the

Re: View count ignore auto_now

2009-10-26 Thread TheIvIaxx
yeah i think thats what i will have to do, but you end up treating the view count as a separate object. Or i can just take the auto_now off and just do my own date updates on the save method. just thought there may have been a built in way to do it :) On Oct 26, 5:35 pm, Matt Schinckel wrote:

Putting django based site on HTTPS

2009-10-26 Thread zweb
I want to serve whole of my site on HTTPS. But HttpResponseRedirect is sending to http by default. Any way to tell django that it should use https and not http I am using mod_python on one site and mod_wsgi on another. Both need to go to HTTPS --~--~-~--~~~---~--~

Re: Putting django based site on HTTPS

2009-10-26 Thread Graham Dumpleton
On Oct 27, 2:20 pm, zweb wrote: > I want to serve whole of my site on HTTPS. > But HttpResponseRedirect  is sending to http by default. > > Any way to tell django that it should use https and not http > > I am using mod_python on one site and mod_wsgi on another. Both need > to go to HTTPS For

Login over HTTPS

2009-10-26 Thread Jani Tiainen
I'm trying to get Django to make authentication (namely username + password) to be transferred over HTTPS. But rest of the site is still on plain old HTTP. How this can be done? I've very little success and google didn't gave much of help either. I'm using Apache 2.2 with mod_wsgi and I've to