Re: how to implement a data grid? (or populate inlineformset with initial data)

2011-05-31 Thread jai_python
Hi, Long back i had used Dojo data grid, plz go through my blog http://jayapal-d.blogspot.com/2009/08/dojo-datagrid-with-editable-cells-in.html I am sure that we can do with jquery. Lemme know if u required any help. Thanks, Jayapal On May 31, 6:39 am, snfctech wrote: > I want to display a

Re: admin site search field

2011-05-31 Thread delegbede
First, you did enclose doc properly. You wrote 'doc instead of 'doc'. Sort that first. I'm however not suggesting that is the solution. Regards. Sent from my BlackBerry wireless device from MTN -Original Message- From: podio Sender: django-users@googlegroups.com Date: Mon, 30 May 2011 16:

Re: python code works in command line but not in django

2011-05-31 Thread bruno desthuilliers
On May 30, 3:54 pm, Kann wrote: > Dear all, > > I tried using python to execute some external java program in my code. > My problem is the os.system(cmd) was not working properly "not working properly" is possibly not the most informative description of your problem... What happens ? Get a trac

Re: python code works in command line but not in django

2011-05-31 Thread Lucian Nicolescu
I don't think there's any way this could work. From what I can tell Kann is trying to invoke the java interpreter ... but he does it on the server, not on the user's machine - that's why it only works when the two are the same. So he should try to invoke it somehow else, maybe embed it in a html p

Re: Can I perform an "alter table" to remove a "not null" constraint?

2011-05-31 Thread Kirill Spitsin
On Mon, May 30, 2011 at 09:52:27PM -0700, Gchorn wrote: > It seems as though the default in Django when creating tables is to > place a constraint that doesn't allow null values (contrary to what > I've learned is the default for SQL in general). I have a model which > has a date attribute, and wh

Re: python code works in command line but not in django

2011-05-31 Thread bruno desthuilliers
On May 31, 10:32 am, Lucian Nicolescu wrote: > I don't think there's any way this could work. Oh yes ? Why so ? > From what I can tell > Kann is trying to invoke the java interpreter ... Indeed. > but he does it on > the server, not on the user's machine And ? > - that's why it only works w

Model 'Child' is inherited from 'Parent', trying to filter to get only Child results with Parent.objects.filter(...)

2011-05-31 Thread robin
Example code: class Parent(models.Model): name = models.CharField(max_length='20',blank=True) class Child(Parent): pass I want to get the result of Child.objects.all() but I DO NOT want to use Child. I want to use Parent instead, which I tried to do with: Parent.objec

Re: python code works in command line but not in django

2011-05-31 Thread Lucian Nicolescu
Hey Bruno, Sorry if I misunderstood the initial posting, please enlighten me/us with a solution for the problem. Lucian On Tue, May 31, 2011 at 11:48 AM, bruno desthuilliers wrote: > > On May 31, 10:32 am, Lucian Nicolescu wrote: >> I don't think there's any way this could work. > > Oh yes ? W

Re: python code works in command line but not in django

2011-05-31 Thread Kann
Hi All, I apologize for now being specific enough. The java script should read files in "tmp/medusa" and use "Medusa.jar" as the referenced class to run. The result of the script should be a png image using data from files inside "tmp/medusa" I tested the java command via terminal and it worked f

Re: Serving static file on Windows

2011-05-31 Thread Alagu Madhu
Hi, I use Django 1.3. sample/ static/ js/jquery.1.6.1.min.js css/ settings.py APP_DIR = os.path.abspath(os.path.dirname(__file__)) STATIC_ROOT = os.path.join(APP_DIR, 'static/') STATIC_URL = 'http://192.168.1.141:44/static/' TEMPLATE_D

Problem with layout

2011-05-31 Thread Isaac XxX
Hi friends, recently I upgraded my django installed version to 1.3. To test it, i got a free html/css template from a page, and started a little web. The surprise came when I open development webserver, with all static files configured properly, and the resulting website (without any modification

Re: Is there an HTML editor that's Django-aware

2011-05-31 Thread Simon Connah
On 31 May 2011, at 00:20, AJ wrote: > If I can give my $0.02, the content can live anywhere, but how about at least > a link to the content within the initial "setting up django environment' > section? > > This way those who are just beginning programming and Django can know what do > they nee

Re: python code works in command line but not in django

2011-05-31 Thread bruno desthuilliers
On May 31, 11:29 am, Kann wrote: > Hi All, > > I apologize for now being specific enough. The java script s/script/application/ Please let's not confuse Java with javascript ;) > should read > files in "tmp/medusa" and use "Medusa.jar" as the referenced class to > run. The result of the script

Re: python code works in command line but not in django

2011-05-31 Thread Kann
Hi Bruno, I tested with both system's python shell and the "manage.py shell", and both of them also worked. The PNG file was created properly. I also check the path returned from os.path.abspath() and both of them are ok as well. Now I am testing using the Django embedded development server. Ka

Re: Serving static file on Windows

2011-05-31 Thread Alagu Madhu
Hi, I use Django 1.3. sample/ static/ js/jquery.1.6.1.min.js css/ settings.py APP_DIR = os.path.abspath(os.path.dirname(__file__)) STATIC_ROOT = os.path.join(APP_DIR, 'static/') STATIC_URL = 'http://192.168.1.141:44/static/' TEMPLATE_DIRS

Latching onto IPB board

2011-05-31 Thread Cody Woolaver
Hello, I'm looking to use django just as a back-end to handle requests made from some of the programs the website develops. It is currently setup on an IPB forum and i would like to be able to access the data stored in the database in much the same way that you would if it was a django made databa

BadValueError: Property title is required

2011-05-31 Thread michal.bulla
Hello, I'm trying to create simple method to create category. I set the model category: class Category(db.Model): title = db.StringProperty(required=True) clashes_count = db.IntegerProperty(default=0) And the class New Category as well : class NewCategoryPage(webapp.RequestHandler): def get(

Passing parameters to form class

2011-05-31 Thread skyde
Hello, I've hit a brick wall while trying to create dynamic forms. Basically I am trying to give parameter to a class form and then based on that do a multiple choice questionaire. For example def somefunction(): formi = someForm(ids='1') class someForm(forms.Form): # get id from, use it

How to create user on mobile app for Django site?

2011-05-31 Thread Ivo Brodien
What is the correct way to do the following: 1) Mobile App from which a user can create a user/profile on the Django site 2) Allow authenticated users to create on the site and query personalized data from the site This is what I guess I have to do: 1) Create a REST API (probably with e.g. dja

Re: Why self-defined session_key got changed when save in DB?

2011-05-31 Thread Tom Evans
On Sat, May 28, 2011 at 4:00 AM, Jimmy wrote: > Hi, > > I have following code to set self-defined session_key: > from django.contrib.sessions.backends.db import SessionStore from django.contrib.sessions.models import Session a = SessionStore(session_key="fwefwejfo3j20jf02jnfweojfeo"

Re: admin site search field

2011-05-31 Thread podio
yes, that was that I copy and didn't select de ', so when I pasted I saw only the missing bracket. On 31 mayo, 04:07, delegb...@dudupay.com wrote: > First, you did enclose doc properly. You wrote 'doc instead of 'doc'. > Sort that first. I'm however not suggesting that is the solution. > Regards.

Re: python code works in command line but not in django

2011-05-31 Thread bruno desthuilliers
On May 31, 12:25 pm, Kann wrote: > Hi Bruno, > > I tested with both system's python shell and the "manage.py shell", > and both of them also worked. The PNG file was created properly. Ok. > I also check the path returned from os.path.abspath() and both of them > are ok as well. Ok. > Now I am

Re: BadValueError: Property title is required

2011-05-31 Thread bruno desthuilliers
On May 31, 11:45 am, "michal.bulla" wrote: > Hello, > > I'm trying to create simple method to create category. I set the model > category: > > class Category(db.Model): >  title = db.StringProperty(required=True) >  clashes_count = db.IntegerProperty(default=0) Are you sure you posted on the rig

Accessing request.user in formset validation

2011-05-31 Thread Carsten Fuchs
Hi all, in some of my forms and formsets I need access to request.user in form validation. With an individual form, I pass request.user as a parameter to the constructor, using code like this: class ErfasseZeitraumForm(forms.Form): von= forms.DateField(widget=AdminDateWidget())

Re: Is there an HTML editor that's Django-aware

2011-05-31 Thread Tom Evans
On Mon, May 30, 2011 at 2:41 PM, Jacob Kaplan-Moss wrote: > On Monday, May 30, 2011, BobX wrote: >> If anyone from the Django Project itself is listening then can I (very >> humbly) suggest that some editor recommendations would make a real >> fine addition to the info on the site (useful to n00b

Re: Is there an HTML editor that's Django-aware

2011-05-31 Thread Jean-Pierre De Villiers
I would suggest a section that all that newbies can visit on the website, with links to various text editors so that they can make their own decisions depending on their own personal preference etc. Cheers JP De Villiers On Tue, May 31, 2011 at 3:26 PM, Tom Evans wrote: > On Mon, May 30, 2011

Re: Accessing request.user in formset validation

2011-05-31 Thread Tom Evans
On Tue, May 31, 2011 at 2:21 PM, Carsten Fuchs wrote: > Hi all, > > in some of my forms and formsets I need access to request.user in form > validation. > > With an individual form, I pass request.user as a parameter to the > constructor, using code like this: > > class ErfasseZeitraumForm(forms.F

Re: python code works in command line but not in django

2011-05-31 Thread Kann
I am just new to programming and not quite familiar with pdb. But I assume that this is what you are talking about: http://docs.python.org/library/pdb.html Perhaps, I will look into it. Thanks for your suggestions. :) Kann On May 31, 3:13 pm, bruno desthuilliers wrote: > On May 31, 12:25 pm,

Re: Learning Django: Approach / Advice / Resources

2011-05-31 Thread Derek
On May 30, 9:30 pm, Robin wrote: > A little while ago, I was approached about building a basic web site > for a small store.  The requirements were pretty typical and read like > a menu of web development tutorials.  This was to be a data driven > site that any decent web developer could build.  I

Re: python code works in command line but not in django

2011-05-31 Thread bruno desthuilliers
On May 31, 4:06 pm, Kann wrote: > I am just new to programming and not quite familiar with pdb. But I > assume that this is what you are talking about: > > http://docs.python.org/library/pdb.html Yes, that's it. This and the logging module are tools that are really worth spending some time lea

Re: how to implement a data grid? (or populate inlineformset with initial data)

2011-05-31 Thread snfctech
Thanks, Jayapal. I was hoping there was a little less java/ more django way to do this by utilizing a Django ModelForm or InlindeFormSet and rendering partial views. So am I missing the point of InlineFormSets? Can these not be populated with data so they can be used to edit a set of existing re

Re: How to I create download link of some file using django

2011-05-31 Thread Kann
Dear all, I am a bit confused about how to set the MEDIA_URL variable here. Currently, I am testing the web using Django embedded webserver and doesn't have a proper url yet. Should my MEDIA_URL be something like... http://my_machine_name:8000/media/ Kann On May 26, 12:42 pm, Boštjan Mejak wrot

Re: how to implement a data grid? (or populate inlineformset with initial data)

2011-05-31 Thread Javier Guerra Giraldez
On Tue, May 31, 2011 at 9:20 AM, snfctech wrote: > I was hoping there was a little less java/ more django way to do this i haven't seen any Java around Dojo toolkit -- Javier -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

Re: How to I create download link of some file using django

2011-05-31 Thread Ivo Brodien
Hi did you read this documentation about serving static files? In generally you don’t want serve files through django, but through your actual webserver (e.g. Apache, nginx, lighttpd...). However during development you can make django serve them. See: Serving static files in development https:

Re: How to I create download link of some file using django

2011-05-31 Thread Ivo Brodien
> I am a bit confused about how to set the MEDIA_URL variable here. > Currently, I am testing the web using Django embedded webserver and > doesn't have a proper url yet. Should my MEDIA_URL be something > like... http://my_machine_name:8000/media/ yes, but so in your template you do: > ### in

Re: how to implement a data grid? (or populate inlineformset with initial data)

2011-05-31 Thread Daniel Roseman
On Tuesday, 31 May 2011 15:20:11 UTC+1, snfctech wrote: > > Thanks, Jayapal. > > I was hoping there was a little less java/ more django way to do this > by utilizing a Django ModelForm or InlindeFormSet and rendering > partial views. > > So am I missing the point of InlineFormSets? Can these n

Re: Does django 1.3 has a ubuntu deb package released!

2011-05-31 Thread Tobias Quinn
You can always install the debian package from: http://packages.debian.org/wheezy/python-django which seems to work fine... On Apr 30, 3:29 am, Korobase wrote: > Does django 1.3 has a ubuntu deb package released ! > I have googled but get none,Any one have done this? > Thanks. > > -- -- You r

Re: admin site search field

2011-05-31 Thread podio
I found one solutions: field = models.OneToOneField("self") Im now searching how have a search form instead of a combo box. On 31 mayo, 10:10, podio wrote: > yes, that was that I copy and didn't select de ', so when I pasted I > saw only the missing bracket. > > On 31 mayo, 04:07, delegb..

Re: Accessing request.user in formset validation

2011-05-31 Thread Carsten Fuchs
Hi Tom, wow, perfect!! A thousand thanks for your help and example code! :-D Best regards, Carsten -- Cafu - the open-source Game and Graphics Engine for multiplayer, cross-platform, real-time 3D Action Learn more at http://www.cafu.de -- You received this message because you a

Re: How to I create download link of some file using django

2011-05-31 Thread Kann
Thanks for your help Ivo, I have another question here. It seems that django.contrib.staticfiles can be used to handle some static files during the 'debug' mode while using the embedded 'runserver' from django. However, would it be possible if I just develop my website using the system's Apache an

Re: How to create user on mobile app for Django site?

2011-05-31 Thread shacker
On May 31, 4:35 am, Ivo Brodien wrote: > What is the correct way to do the following: > > 1) Mobile App from which a user can create a user/profile on the Django site > 2) Allow authenticated users to create on the site and query personalized > data from the site My approach would be to: 1) Bui

Re: Learning Django: Approach / Advice / Resources

2011-05-31 Thread Robin
You guys are spectacular! Thanks! I'll give these replies a few reads and just keep plugging along. I'm going to sort of circle back and see if it wouldn't be a good idea to restart my project with a fresh set of eyes now that I've spent a bit of time with Django. Derek, The test cookie thing

Re: How to I create download link of some file using django

2011-05-31 Thread Ivo Brodien
you are welcome! > I have another question here. It seems that django.contrib.staticfiles > can be used to handle some static files during the 'debug' mode while > using the embedded 'runserver' from django. However, would it be > possible if I just develop my website using the system's Apache and

Chained forms

2011-05-31 Thread Marc Aymerich
Hi!, I'm writing an admin action. This action needs to collect some information before execute the "final task". In order to collect this information the user should fill 3 consecutive forms, (once they submitted one, another is rendered). My question is, How can I store the form fields state subm

apache+mod_wsgi, redirect to https

2011-05-31 Thread refreegrata
Hello guys and girls. I have a question. In my apache configuration I have this: WSGIScriptAlias /misite "rute_to_file.wsgi" The users can access from: http://mysite/ and https://mysite/ I need to enable the access only from "https://mysite/";. Every access from "http://mysite/"; must to be red

Re: how to implement a data grid? (or populate inlineformset with initial data)

2011-05-31 Thread snfctech
Thanks for your reply, Daniel. I read the docs, but did not understand them properly. Your explanation makes sense, but doesn't seem to be working for me, for some reason. I followed the docs from https://docs.djangoproject.com/en/1.3/topics/forms/modelforms/#inline-formsets precisely, but am ge

Re: How to create user on mobile app for Django site?

2011-05-31 Thread Ivo Brodien
Thanks for sharing your opinion! Your approach is probably good for many website/applications, but since I want to make use of InApp Purchases and Camara Overlays and Custom Controls, I don’t think this is the right way to go. I was impressed by PhoneGap though... 2 or 3 years ago I was seeing

Re: Chained forms

2011-05-31 Thread DrBloodmoney
On Tue, May 31, 2011 at 12:55 PM, Marc Aymerich wrote: > Hi!, > I'm writing an admin action. > This action needs to collect some information before execute the "final > task". > In order to collect this information the user should fill 3 consecutive > forms, (once they submitted one, another is re

Multiple inheritance from models.Model and admin.ModelAdmin

2011-05-31 Thread Lee
I'm trying to create a class that inherits from both models.Model and admin.ModelAdmin, so that I can use models.ManyToManyField and save_model() from admin.ModelAdmin. Unfortunately this combination gives "metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the

Re: apache+mod_wsgi, redirect to https

2011-05-31 Thread Michael Scovetta
I usually set up two virtual hosts, one listening on port 80 and the other on 443. The virtual host listening on port 80 just redirects to the other one: ServerAdmin ad...@example.com ServerName domain.com HostnameLookups Off UseCanonicalName On ServerSignature Off Red

Re: apache+mod_wsgi, redirect to https

2011-05-31 Thread refreegrata
Thanks men, I did this: -- ... ... RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} ... Works ok to me. Now I must to test the "Require Auth". Bye. On 31 mayo, 13:33, Michael Sc

"invalid label' as it pertains to application name

2011-05-31 Thread Bobby Roberts
I am getting a pretty non-descript error reading "Caught RuntimeError while rendering: invalid label: cigar-wizard" when i go to a certain url on my website. This isn't a form label... it's referring to an application name. Any ideas what that means? -- You received this message because you are

Re: Django DATETIME_FORMAT Localization

2011-05-31 Thread Kirill Spitsin
On Wed, May 25, 2011 at 10:46:30AM -0700, jrs_66 wrote: > How can I do something like strptime(request.POST["start-date"], > mycurrent_DATETIME_FORMAT)... There's got to be an undocumented way of > referencing the constant currently being used? I guess you need `django.utils.formats.date_format` f

FreeBSD fastcgi rc.d script

2011-05-31 Thread Jon J
It took me a bit to figure out the particulars of this, but I thought I'd give it to the community, in case someone comes looking for the same solution. #!/bin/sh # # PROVIDE: myapp # REQUIRE: DAEMON # KEYWORD: shutdown # # Notes on usage: Just adjust the location and name of your app as needed.

how to display a property in a ModelFormSet?

2011-05-31 Thread snfctech
I'm using a ModelFormSet to display and edit multiple records. Some of those records have related attributes that I want to display, but not edit. E.g. lineitem.quantity [editable] lineitem.product.description [not editable] So I thought I would add a property to my LineItem class in order to r

Re: Multiple inheritance from models.Model and admin.ModelAdmin

2011-05-31 Thread Lee
Discovered that save_model() is still available even if I don't inherit admin.ModelAdmin, which avoids the metaclass conflict. On May 31, 10:36 am, Lee wrote: > I'm trying to create a class that inherits from both models.Model and > admin.ModelAdmin, so that I can use models.ManyToManyField and >

Re: Auditing Record Changes in All Admin Tables

2011-05-31 Thread Lee
Thanks for that tip Ryan. Here's the relevant models.py code I used to get this to _almost_ work: - class AuditedTable(models.Model): created = models.DateTimeField(auto_now_add=True) created_by = models.CharField(blank=True,max_length=20) updated = models.DateTimeField(auto_n

Re: Auditing Record Changes in All Admin Tables

2011-05-31 Thread Ryan
That code is supposed to go in the models admin definition like so: admin.py: -- class AuditAdmin(admin.ModelAdmin): def save_model(self, request, obj, form, change): obj.user = request.user obj.save() Ryan -- You received this message bec

django-profiles and get_absolute_url

2011-05-31 Thread Andrew Sledge
Hi All, I am having trouble getting an absolute URL using the django-profiles module with usernames that have periods in them (for instance "/ profiles/user.1"). Here is my profile class: class UserProfile(models.Model): user = models.ForeignKey(User, unique=True) web_site = models.URLField(

Re: django-profiles and get_absolute_url

2011-05-31 Thread Matías Aguirre
Hi, Could you share the URL rule for profiles_profile_detail? Matías Excerpts from Andrew Sledge's message of Tue May 31 17:37:20 -0300 2011: > Hi All, > > I am having trouble getting an absolute URL using the django-profiles > module with usernames that have periods in them (for instance "/ >

Re: django-profiles and get_absolute_url

2011-05-31 Thread Andrew Sledge
Don't think that has anything to do with it, but here goes... url(r'^profiles/', include('profiles.urls')), The remaining url config is provided by django-profiles. On May 31, 4:46 pm, Matías Aguirre wrote: > Hi, > > Could you share the URL rule for profiles_profile_detail? > > Matías > > Excer

spawning threads within test cases in django test framework

2011-05-31 Thread Brian
I've got a django app with a periodically scheduled background task that updates the database. I've written a bunch of tests for its principal class that are run as part of the django unit test framework. I want to convert the class to do its work using multiple threads, but I'm having trouble

Re: Passing parameters to form class

2011-05-31 Thread christian.posta
Yes, you will want to do this within the __init__ method. Run the super class's init method first so that everything's initialized as normal. Then you will have to grab the field for that instance within the __init__ method (self.fields['vaihtoehdot']) and set the choices property for it. On M

Re: django-profiles and get_absolute_url

2011-05-31 Thread Matías Aguirre
This is the value for such url definition: url(r'^(?P\w+)/$', views.profile_detail, name='profiles_profile_detail'), the rule uses \w+ which doesn't match the dot character. Example: >>> import re >>> r = re.compile('(\w+)') >>> r.match('name.1').groups() ('name',) >>> r

Re: django-profiles and get_absolute_url

2011-05-31 Thread Andrew Sledge
Thank you Matias. Your syntax was a little off, but you did solve it. Here is the correct syntax: import profiles ... ... ... url(r'^profiles/(?P[\w\.]+)/$', 'profiles.views.profile_detail', name='profiles_profile_detail'), I will submit a patch to django-profiles to support the characters "@/./

Re: Auditing Record Changes in All Admin Tables

2011-05-31 Thread Lee
Moved it to admin.py but it ignores the auto_now parameters (leaving timestamps blank) and doesn't populate the created_by/updated_by fields either: class AuditAdmin(admin.ModelAdmin): created = models.DateTimeField(auto_now_add=True) created_by = models.CharField(blank=True,max_length=20) u

Re: Does django 1.3 has a ubuntu deb package released!

2011-05-31 Thread Ernesto Guevara
In Ubuntu 10.04 repository stlll 1.1 version. =/ 2011/5/31 Tobias Quinn > You can always install the debian package from: > > http://packages.debian.org/wheezy/python-django > > which seems to work fine... > > On Apr 30, 3:29 am, Korobase wrote: > > Does django 1.3 has a ubuntu deb package rele

Re: Is there an HTML editor that's Django-aware

2011-05-31 Thread Kenneth Gonsalves
On Tue, 2011-05-31 at 14:26 +0100, Tom Evans wrote: > > Where do you think such information should live? That is, at what > > point in your process of learning Django would information about > > editors have been helpful? Somewhere in the tutorial, or after? > > Before? > > > > Thanks, > > > > Jaco

Re: Model 'Child' is inherited from 'Parent', trying to filter to get only Child results with Parent.objects.filter(...)

2011-05-31 Thread robin
Shall I report the inability of using Parent.objects.filter(child__isnull=False) as a bug? -- 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

Re: Model 'Child' is inherited from 'Parent', trying to filter to get only Child results with Parent.objects.filter(...)

2011-05-31 Thread Matías Aguirre
This worked on on Django 1.2.5: Parent.objects.exclude(child__isnull=True) Does it work for you? Excerpts from robin's message of Tue May 31 05:53:26 -0300 2011: > Example code: > >class Parent(models.Model): > name = models.CharField(max_length='20',blank=True) > > class C