ValueError when uploading image

2009-08-06 Thread Mac
Hi, I'm new to Django and programming in general. I've been trying to create a form that simply uploads images and saves them to a app folder. I'm using MySql with Django svn. Here's my model: class Images(models.Model): prim = models.AutoField(primary_key=True, db_column='PRIM') # Field nam

Apache2 permission denied problem

2009-08-08 Thread Mac
Hi, I'm new to Django, and am trying to write a csv file and attach it to an email that is sent upon completion of a sales order. All works fine in the developement server, but when I switch to Apache2 I get an error message that either says' No such file or directory, ../orders1/ csv_files/ or P

How to widen the text fields in the admin pages for editing records

2009-04-07 Thread Mac
Any pointers to the documentation for getting the text fields larger for CharField data? They're kinda puny for columns that are defined to have up to 255 characters. Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: How to widen the text fields in the admin pages for editing records

2009-04-07 Thread Mac
On Apr 7, 6:56 pm, Brian Neal wrote: > On Apr 7, 3:04 pm, Mac wrote: > > > Any pointers to the documentation for getting the text fields larger > > for CharField data?  They're kinda puny for columns that are defined > > to have up to 255 characters.  Thanks! > &

Re: How to widen the text fields in the admin pages for editing records

2009-04-07 Thread Mac
On Apr 7, 8:15 pm, TiNo wrote: > You can override the ModelAdmin.form attribute to provide your own > customized form. > See:http://docs.djangoproject.com/en/dev/ref/contrib/admin/#form Excellent, thanks! --~--~-~--~~~---~--~~ You received this message because yo

problem rendering html images in browser

2009-05-03 Thread Mac
I've had trouble rendering images in my browser. I just get a broken link. Any thoughts on how to fix this? I'm working with the development server, and I've check my code carefully to insure the to the image file is correct. If I open the html template file with my browser, it does render the im

jquery ajax form problem--Can't render template variables

2009-06-09 Thread Mac
I'm new to programming and can't figure out how to properly render the {{comment}} and {{username}} variables in the element below using jquery and the ajax form plugin. Everything posts to the database just as it should. However, I want to show what gets posted in the template after submission.

Problems deserializing json object

2010-01-05 Thread Mac
I'm having difficulty deserializing a json object. I'm using django appengine patch, so the models aren't the same as django's, but they are very similar: class Cust(db.Model): custno = db.StringProperty(required=True) company = db.StringProperty(required=True) contact = db.StringPrope

Problems with HttpResponseRedirect(reverse()) No match found

2010-01-07 Thread Mac
Hi, I've read the django docs here: http://docs.djangoproject.com/en/dev/topics/http/urls/#reverse and am still having trouble with redirecting my views. Here is my view: def skipant_sale(request, notes=''): notes=notes if request.method == 'POST': # If the form has been submitted...

admin error, cannot edit fields or delete records, url refers to incorrect primary key

2012-05-18 Thread Mac
I've set up a 'Reps' model in the admin. I can add records successfully, but if I try to change a record or field, I get a 404 error. When I try to delete a record, I get this traceback here: http://dpaste.com/750121/ My primary keys are integers, but it appears that the urls return them as floats.

Re: Billing and invoicing app?

2012-10-23 Thread Mac
know if this is what you are looking for, but I hope this helps. Mac On Tuesday, October 23, 2012 7:27:20 PM UTC-7, Jesramz wrote: > > Thanks Mike! > > I tried djangopackages and didn't find anything. I was wondering if > anyone had a package that they found useful that migh

Python 2.7+Windows 7+Django1.4 + Apache2.2 +mod_wsgi

2011-10-03 Thread Mac
For what it's worth, on Windows I like to use Apache2.2 for development purposes instead of the built in server that you have to fire up using the shell command, manage.py runserver every time you need it. On a Windows 7 machine, I followed the instructions to set up my apache server with django h

Re: Django Baseball Site Model

2013-01-16 Thread Mac
then he wasn't traded, if 1 this is his 2nd team, etc... Hope this helps, Mac On Wednesday, January 16, 2013 3:59:24 PM UTC-8, David Gomez wrote: > > Hi, I would like to make a website about baseball player from an specific > country, but I'm stock how to make the model

Re: How To Populate A Dropdown List

2011-02-09 Thread Mac
Here's some sample code that works for me: in models.py class InventoryCloseouts(models.Model): prim = models.IntegerField(primary_key=True, db_column='PRIM') # Field name made lowercase. items = models.CharField(max_length=255, db_column='ITEMS', blank=True) # Field name made lowe gen

Remote working job opportunity for Python/Django programmers

2011-11-10 Thread Gordon Mac
Hello Python/Django techies, One our client is in need of Python/Django programmer for developing web based casino gaming software using Python,Django,HTML5,Flash, mySQL. Job Requirements: Expert level experience in gathering casino games software requirements, normalization of data,design & imp

Toby McGuire

2018-11-12 Thread toby mac
Im a newbie to this. Used to program on COBOl, Fortran and 370 assembler, plus many others -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr

Re: Possible Model Inheritance Issue? Error: [Model_Name] instance needs to have a primary key value before a many-to-many relationship can be used

2009-01-20 Thread Martin Conte Mac Donell
On Wed, Jan 21, 2009 at 2:35 AM, Keyton Weissinger wrote: > > Oh and just to re-state, this exact same code works like a champ on > import of School or Parent data (neither of which have a ManyToMany > field). > > Keyton I can't reproduce this exception. Try to print import_object_dict just befo

Re: Possible Model Inheritance Issue? Error: [Model_Name] instance needs to have a primary key value before a many-to-many relationship can be used

2009-01-21 Thread Martin Conte Mac Donell
Again, i can't reproduce your problem. It's working using SVN HEAD with your model and this view: http://dpaste.com/111590/. Could you try to use that dict and Student(**mydict) instead of "model_import_info.model_for_import.objects.create" ? Regards, M On Wed, Jan 21, 2009 at 3:06 PM, Keyton W

Re: TypeError: 'tuple' object is not callable

2009-01-23 Thread Martin Conte Mac Donell
On Fri, Jan 23, 2009 at 8:37 AM, joti chand wrote: > File "C:\Python25\Lib\site-packages\django\core\urlresolvers.py", > line 205, in _get_url_patterns >patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) > > File "C:\Python25\Lib\site-packages\django\core\urlresolve

Re: Strange Model behavior

2009-01-25 Thread Martin Conte Mac Donell
On 1/26/09, Mark Jones wrote: > class Fails(models.Model): > code = models.CharField(max_length=64) > quizid = models.IntegerField(null=False, blank=False) > published_on = models.DateTimeField(auto_now_add=True) > > def __init__(self, *args, **kwargs): > super(Fails, sel

Re: Using hashing for password checking in auth module

2009-01-30 Thread Martin Conte Mac Donell
On Fri, Jan 30, 2009 at 5:36 PM, Guy Rutenberg wrote: > I've started using Django recently and when I've used the auth module > I noticed that it only verifies a plain text password. I'm not > comfortable with this behaviour as it means that passwords have to be > sent by login forms in plain tex

Re: Filter by ForeignKey reference??

2009-02-02 Thread Martin Conte Mac Donell
On Mon, Feb 2, 2009 at 10:11 PM, Markus T. wrote: > > Hi, > > I have two simple models: > > class Country(models.Model): > name = models.CharField(_("Name"), max_length=50, > unique=True) > > class Profile(models.Model): > name = models.CharField(_("Name"), max_length=50, > un

Re: Filter by ForeignKey reference??

2009-02-02 Thread Martin Conte Mac Donell
On Mon, Feb 2, 2009 at 11:59 PM, Martin Conte Mac Donell wrote: > If you need country_id/country_name: > >>>> Profile.objects.values('country__id', >>>> 'country__name').select_related('country').distinct() > [{'country__n

Re: forms not valid

2009-02-02 Thread Martin Conte Mac Donell
On Mon, Feb 2, 2009 at 11:35 PM, vierda wrote: > > Hi all, I have three forms and none of these forms pass is_valid() > test when I test in intrepeter. kindly help for point out what's > problem with my forms. thank you. > > from django.contrib.auth.models import User > from django.contrib.auth.f

Re: how to check manytomany field in filter?

2009-02-02 Thread Martin Conte Mac Donell
On Tue, Feb 3, 2009 at 12:21 AM, garagefan wrote: > > Trying to test a manytomany field in a model that will be user names. > Building that is simple enough in the model, and so is selecting the > users in the admin. > > the problem is filtering a query to test the current logged in user > with t

Re: Making fields conditionally required based on another field's state

2009-02-02 Thread Martin Conte Mac Donell
On Mon, Feb 2, 2009 at 7:21 PM, wotaskd wrote: > > Hello everyone, a quick (and I guess easy) one: > > Is there any way, on the admin site, to make a field for a model > mandatory, if another one is blank and vice-versa? Yeap, you need to write your own form class, subclass clean() method do you

Re: [slightly offtopic] Which Python are people using on OSX?

2009-02-05 Thread Martin Conte Mac Donell
On Thu, Feb 5, 2009 at 7:07 PM, cjl wrote: > Honestly, I'm leaning towards option number 5. I'm just wondering what > other Django folks are using. I'm using MacPorts. It's the practical way. (x11? really?. Which version are you trying?) I'm using those ports: # port installed | grep py py25

Re: Using forloop.counter0 on a variable

2007-12-17 Thread Martin Conte Mac Donell
You can do that with a very simple template tag register = template.Library() @register.simple_tag def get_element(list, index): # You should catch IndexError here. return list[index] Template side: {% get_element secondprice forloop.counter0 %} Regards, Martin Conte Mac Donell

Re: Problem trying to configure Django with FastCGI and Lighttpd

2007-12-17 Thread Martin Conte Mac Donell
Which version of django are you using? What do you see on lighttpd logs? Is port 3303 open with fcgi process? Regards, Martin Conte Mac Donell On Dec 17, 2007 4:23 PM, Chris Moffitt <[EMAIL PROTECTED]> wrote: > Take a look in the lighttpd server logs to see if there are any errors >

Re: Using forloop.counter0 on a variable

2007-12-17 Thread Martin Conte Mac Donell
What about $ {% filter floatformat:2 %} {% get_element secondprice forloop.counter0 %} {% endfilter %} Regards, -- Martín Conte Mac Donell On Dec 17, 2007 6:53 PM, Greg <[EMAIL PROTECTED]> wrote: > > Martin, > Yep...that worked. Thanks! > > However,