Customising slugify filter

2008-11-19 Thread Nick
racked down the slugify filter to django/template/ defaultfilters.py, but can't get my head round the regular expressions required to replace "/" with "-". Alternatively, instead of changing the core Django install, can I "extend" slugify in my own

Ad Management System

2008-11-23 Thread Nick
I'm exploring whether or not to use Django for redesigned website and the only thing I haven't really been able to find out is whether there is an existing, portable, robust solution for advertising management on the site. This would need to control what advertising goes where, track its performan

HTTPS and URL form field validation

2008-12-15 Thread Nick
o rebuilt mod_python. Any ideas on what could be going on? Thanks. Nick --~--~-~--~~~---~--~~ 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: lighttpd + fcgi + FORCE_SCRIPT_NAME = admin grief

2008-08-21 Thread Nick
roject.com/wiki/BackwardsIncompatibleChanges#ChangedthewayURLpathsaredetermined Which maybe need to change given that the rest of the config is plain- vanilla-as-per-the-tutorial? Regards, Nick On Aug 21, 6:08 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Thu, 2008-08-21 at 10:02 -0700, James

Validating ImageField width and height in admin site

2008-09-09 Thread Nick
w this would be used within the save method to prevent the record from saving if the image size were incorrect. Any help would be very much appreciated :) Thanks, Nick --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "

Re: Validating ImageField width and height in admin site

2008-09-20 Thread Nick
Anybody? I can't find a simple example of this anywhere so any help would be great :) Nick --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email

DeprecationWarning: Non-ASCII character in models.py

2008-09-30 Thread Nick
with the help_text, specifically the £ symbol. Can anybody shed some light on how I can fix this, presumably I need to declare an encoding, or there is an encoding mismatch going on somewhere? Thanks, Nick --~--~-~--~~~---~--~~ You received this message because you

Re: Django critter helps us code at the speed of light.

2009-03-12 Thread Nick
On Mar 11, 6:10 pm, Eric Walstad wrote: > > Now you can have your pony AND a Django > Critter:http://starship.python.net/~ewalstad/django_critter.html > Excellent! I think I prefer the Critter to the Pony... Nick --~--~-~--~~~---~--~~ You r

Need to upload outside of MEDIA_ROOT, but I get SuspiciousOperation error

2009-06-22 Thread Nick
rror. I'd like to do this so all uploaded files are contained outside of SVN's version control. Is this possible? I've tried "chown"ing my uploads directory to apache:apache but this didn't help. Any ideas? Thanks, Nick --~--~-~--~~~---~

Admin of an Admin for an E-Commerce Page

2009-07-05 Thread Nick
I'm looking to write an e-commerce page with very minimal admin functionality, but which also has an extended admin that would facilitate the rest of the basic admin tasks. For example, the basic admin could add products but shouldn't have to know any html or meta- language to do so. They just i

localhost:8000 problem

2009-03-28 Thread nick
I am a django newbie. The first example I tried from django's tutorial "mysite", ran python manage.py runserver. Server runs with no errors but my web browser (firefox) get "Firefox offline mode error" and not django 404 errors. I tried different localhost ports, but same error. My browser doesn't

Re: localhost:8000 problem

2009-03-28 Thread nick
Right after I click "post" to that problem, I realized that "Work Offline" was checked. It works now. Thank you Karen for prompt reply, I appreciate it. I am sure there are more to come :-) On Mar 28, 4:50 pm, Karen Tracey wrote: > On Sat, Mar 28, 2009 at 5:44 PM, ni

Django 1.0 Template Book

2009-03-30 Thread nick
Has anyone bought and read "Django 1.0 Template Development" by Scott Newman? I'd like to know your opinion before I get it. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group

csv download link or views that the modify more than one template...

2009-04-16 Thread Nick
I'm interested in returning both an html view (as a template) and a link to a csv file (either as a template or using the CSV module) in response to a query (GET or POST). Is there a way to both of these actions simultaneously without hitting a database twice and without writing a file to disk?

Django-Storages

2009-09-23 Thread Nick
Hey everyone, I'm working on setting up an app to upload images to s3. I am using David Larlet's djang-storages backends and am running into a pretty annoying problem. When I try to save an entry through the admin I get the following error: Storage module "backends.s3" does not define a "s3sto

Error Message regarding len()

2009-09-25 Thread Nick
I'm using the django-storages backends from David Larlet to upload images to s3 from inside the admin. When i try to run everything I get an error: object of type 'NoneType' has no len() Here is my model: from django.db import models from django.core.files.storage import default_storage as s3_

Re: Error Message regarding len()

2009-09-25 Thread Nick
eturn HMAC(key, msg, digestmod) File "C:\Python25\lib\hmac.py" in __init__ 64. if len(key) > blocksize: Exception Type: TypeError at /admin/StoryWall/statefair/16/ Exception Value: object of type 'NoneType' has no len() On Sep 25, 2:54 pm, Brian McKeever wr

Re: Error Message regarding len()

2009-09-25 Thread Nick
ev.org/django-storages/wiki/S3Storage > > On Sep 25, 2:12 pm, Nick wrote: > > > something like this? > > > Environment: > > > Request Method: POST > > Request URL:http://localhost:8000/admin/StoryWall/statefair/16/ > > Django Version: 1.2 pre-a

starting a project in windows xp

2009-10-19 Thread Nick
an argument to python.exe so it actually executes the file rather than just opening it. I hope this helps if it pertains to you. Nick --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To

feedparser import error

2009-12-18 Thread Nick
ne know why feedparser.py isn't importing? Has anyone else had this problem? I'm using python 26 on windows xp. Thank you, Nick -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us.

Re: Running django on IIS

2010-04-21 Thread Nick
Hiya I have exactly the same problem as described here. Did you (or anyone) find a fix or workaround for this? Cheers! Nick. On Apr 14, 12:24 pm, Paweł Roman wrote: > > I suspect it is trying to import Http but can't. > > > Fire up python (Start -> Python Interactive

send_mail being a royal jerk

2010-04-21 Thread Nick
I am working on a form that takes a little data and throws it in a database, but before all that jazz it sends an email to a list/tuple of recipients. This is going very well except the send_mail process is raising a very annoying and persistent error: "to" argument must be a list or tuple Here i

Re: send_mail being a royal jerk

2010-04-21 Thread Nick
Thanks, Karen. Looks like I was a little cart before the horse on this portion of the project. On Apr 21, 6:28 pm, Karen Tracey wrote: > On Wed, Apr 21, 2010 at 6:09 PM, Nick wrote: > > I am working on a form that takes a little data and throws it in a > > database, but before a

Retrieving an ID from a posted form

2010-04-22 Thread Nick
I am working on a form process with multiple levels of submission. The first is a front facing form with a general set of questions that are to be followed up by someone after the form is submitted (the form submits and entry to the DB). To cut down on the amount of hunting that those who will be

Re: Retrieving an ID from a posted form

2010-04-22 Thread Nick
works like a charm, thanks Ian. On Apr 22, 10:02 am, Ian Lewis wrote: > Nick, > > Because you won't get an id for your newly created object before you > save it you'll need to send the email after you save the form. I'm > assuming that ArtistFormFinal is a Mo

Re: Template composition: Rendering based on permissions

2010-04-28 Thread Nick
The bible for user authentication is found here http://docs.djangoproject.com/en/1.1/topics/auth/ The quick answer to number 2 is to check for authentication in a template tag: {% if user.is_authenticated %} Welcome back you rotten jerk {% else %} Log in, you rotten jerk {% endif %} On Apr 28, 2

Setting readonly_fields dynamically

2010-04-29 Thread Nick
gs, **kwargs) print self.readonly_fields Any help on how I can access readonly_fields from the ModelForm to override it would be really helpful! Thanks, Nick -- You received this message because you are subscribed to the Google Groups "Django users" group. T

Re: Setting readonly_fields dynamically

2010-04-29 Thread Nick
Yes that works, totally missed the get_readonly_fields method - thanks! Nick On Apr 29, 4:40 pm, Daniel Roseman wrote: > On Apr 29, 3:43 pm, Nick wrote: > > > > > > > Hi, > > > I would like to set some fields to be readonly in the Admin app based > > o

Working out some custom API stuff

2010-05-04 Thread Nick
Here's the deal. I'm working on a custom API for moving information about. I am stuck at a point in creating my view. It might be best just to get into the details. Here is the model: class entry(models.Model): question = models.CharField('Question', max_length=200, blank=False) answer =

Re: Working out some custom API stuff

2010-05-06 Thread Nick
red in the URL. There will be another component that will skip the 'count' if it isn't declared but I haven't got there yet. On May 5, 4:11 am, Daniel Roseman wrote: > On May 5, 4:46 am, Nick wrote: > > > > > Here's the deal. I'm w

Re: Working out some custom API stuff

2010-05-06 Thread Nick
Never mind this, I got it figured out. Thanks again On May 6, 12:51 pm, Nick wrote: > Thanks for the help on that portion, it is working wonderfully. > > I've been able to power through most of the requests for this project > but there is one outstanding element in rega

Paginating search results

2010-05-10 Thread Nick
I'm trying to paginate results from a search with multiple options. The only problem is, once I hit the next button it clears the query and I'm left paginating all the objects in the DB. Here is my view: def filter_search(request): if request.POST: reps = Rep.objects.all() else:

Re: How to define different user types?

2010-05-10 Thread Nick
Yeah, this is built in to django. You are on the right track with user.contrib.auth. If you are doing this all from the admin then it's as simple as creating a few groups, giving them the permisions you want and then assigning users to those groups. If you are doing it on a front facing site, the

Re: Paginating search results

2010-05-11 Thread Nick
rder to recreate the object list (reps) when rendering a specific > page (any particular reason why are you using POST in the search > form?). > > hth, > Nuno > > > > On Tue, May 11, 2010 at 1:58 AM, Nick wrote: > > I'm trying to paginate results from a search wit

Re: Paginating search results

2010-05-11 Thread Nick
> > Nuno > > > > On Tue, May 11, 2010 at 2:41 PM, Nick wrote: > > The POST thing was the result of late night meltdowns and desperation. > > I tend to just try stupid things when i'm working through an issue > > like this, just seeing what the application is

Taking on a NoneType error

2010-05-12 Thread Nick
I am using a custom template tag called calculate age to produce an age in numbers based on a filter for a template tag. Here is the tag: def age(bday, d=None): if d is None: d = datetime.datetime.now() return (d.year - bday.year) - int((d.month, d.day) < (bday.month, bday.day))

Re: Taking on a NoneType error

2010-05-12 Thread Nick
ot so it makes more since to have a built in fail safe rather than checking in the templates each time. Thanks a bunch, Dummy On May 12, 12:46 pm, Karen Tracey wrote: > On Wed, May 12, 2010 at 1:06 PM, Nick wrote: > > I am using a custom template tag called calculate age to produce a

Re: Pluggable Q&A app?

2010-05-14 Thread Nick
I actually just got done writing a QandA app. It's very basic. I don't have it open yet but I would turn over the source to you if you wanted. Here are the features: Question Answer Answerer Answerer's credentials site specific QandA (using django.contrib sites) tagging (using django-tagging) cre

send_mail not firing

2010-05-18 Thread Nick
I am having an issue with an authentication app I am writing. The app saves the form appropriately but doesn't send the confirmation email. I am using the same email_host settings as with other application that send email messages but with no results. Here is the process. First a form processes th

Re: send_mail not firing

2010-05-18 Thread Nick
rote: > what happens if you set fail_silently to True? > > On May 19, 12:05 am, Nick wrote: > > > > > I am having an issue with an authentication app I am writing. The app > > saves the form appropriately but doesn't send the confirmation email. > > I am usin

Re: send_mail not firing

2010-05-18 Thread Nick
I get the same results. I dropped into the shell and tried it out >>> user = User(username="nick", email="t...@test.com") >>> send_activation(user) 1 I think the 1 means that it passed but I don't get any emails sent On May 18, 5:08 pm, "ge...@

Re: send_mail not firing

2010-05-18 Thread Nick
eaving it in. On May 18, 5:19 pm, Nick wrote: > I get the same results. > > I dropped into the shell and tried it out > > >>> user = User(username="nick", email="t...@test.com") > >>> send_activation(user) > > 1 > &

Re: send_mail not firing

2010-05-18 Thread Nick
Actually, I've fixed the problem with send_activation. If i go via the form it still doesn't trigger the email. On May 18, 5:19 pm, Nick wrote: > I get the same results. > > I dropped into the shell and tried it out > > >>> user = User(use

Re: send_mail not firing

2010-05-19 Thread Nick
urn render_to_response("obits/register.html", {'form': form }) So, the username and all of that are saving by the user.is_active and send_mail are getting skipped On May 19, 4:37 am, Nuno Maltez wrote: > Anything it the mail server's logs? Any trace of your app trying to

Re: send_mail not firing

2010-05-19 Thread Nick
May 19, 10:07 am, Nick wrote: > It looks like the problem isn't with send_mail, its the save override > on the form, the is_active = False isn't setting that option in the DB > either, so it is skipping over the save options. Here they are again: > > forms.py: &g

If is first time logging in

2010-05-19 Thread Nick
I'm trying to figure out a way to see if it is a users first time logging in after registering on the site. If it is then I will pass them through some formsets, otherwise I let them go to their profile page. I tried using date_joined == last_login but that doesn't work, as the last login date cha

Re: If is first time logging in

2010-05-19 Thread Nick
; login and you will be able to show them again. > > > > > > On Wed, May 19, 2010 at 11:05 PM, Nick wrote: > > I'm trying to figure out a way to see if it is a users first time > > logging in after registering on the site. If it is then I will pass > >

Re: If is first time logging in

2010-05-19 Thread Nick
o you use the generic login view? > > > > > > On Thu, May 20, 2010 at 12:16 AM, Nick wrote: > > I have an expanded user form right now. Here is the sign up process. > > > user registers using username, email, password > > > It sends and activation link to

XML database updates

2010-06-04 Thread Nick
I am working on a project that requires me to grab an XML feed and use it to update entries in a DB that will also be updated by some people doing data entry. I have the workflow for the data entry side all set up but I'm having a hard time finding a resource that can help me write some functions t

Re: XML database updates

2010-06-04 Thread Nick
ere is my first thought for how to do this: feed = urllib.urlopen('http://example.xml/data.xml') tree = ElementTree.parse(feed) for obj in serializers.deserialize(feed, data): obj.save() On Jun 4, 11:14 am, Venkatraman S wrote: > On Fri, Jun 4, 2010 at 9:40 PM, Nick wrote:

Upgrading Python from 2.4 to 2.6 - can I just copy site-packages folder?

2010-06-08 Thread Nick
all located in Python 2.4's site- packages folder. When I upgrade to 2.6, is it just a case of copying these over into 2.6's site-packages folder, or do I need to install the modules afresh? Thanks, Nick -- You received this message because you are subscribed to the Google Groups "D

styling with django templates

2010-06-08 Thread Nick
I am looking for a way to identify the first item returned in a loop and display it differently than the others: basically it would go like: {% for item in items %} {% if is_first_item %} This is what will show {% else %} this is what will show {% endfor %} Am I overlooking some

Re: styling with django templates

2010-06-08 Thread Nick
:05 PM, Dejan Noveski wrote: > > change {% if is_first_item %} with {% if forloop.first %} and you are set. > > > On Tue, Jun 8, 2010 at 7:59 PM, Nick wrote: > > >> I am looking for a way to identify the first item returned in a loop > >> and display it diffe

assigning data based on a comparison between two tables

2010-06-08 Thread Nick
I have two models. One is a list of candidates that have filed to run for office. The second is a list of people who currently hold office. I'd like to compare the two tables and whenever a match is found between the two (an entry in the candidate table shares the same last_name and first_name wit

Re: assigning data based on a comparison between two tables

2010-06-08 Thread Nick
assuming that the models and > stuff are similar. Also, this code is just off the top of my head, so > who knows if it will actually work :) > > Cheers, > > Dan Harris > dih0...@gmail.com > > On Jun 8, 6:30 pm, Nick wrote: > > > I have two models. One is a l

ordering integers with regroup

2010-06-09 Thread Nick
Has anyone come across an ordering issue with the regroup tag whereby if the field that is being ordered is an integer you get the following problem: say you have the grouped field "District" and the following groupings District 1 District 2 District 3 District 10 District 14 District 20 District

Re: ordering integers with regroup

2010-06-09 Thread Nick
District " to it in some other fashion. > > On Jun 9, 10:38 am, Nick wrote: > > > Has anyone come across an ordering issue with the regroup tag whereby > > if the field that is being ordered is an integer you get the following > > problem: > > > say you have

Re: assigning data based on a comparison between two tables

2010-06-09 Thread Nick
Just to let you know, this code worked out nicely. I made a few changes to the bottom save function: if len(candidates) > 1: raise Exception candidates.update(incumbent=True) On Jun 8, 6:11 pm, Nick wrote: > Thanks Dan, I'll give it a shot > > On Jun 8, 6:00 pm,

Re: Upgrading Python from 2.4 to 2.6 - can I just copy site-packages folder?

2010-06-14 Thread Nick
Many thanks for your helpful posts - in the end I just changed a bit of my code to work with 2.4, but this will come in handy for when I finally make the upgrade. Thanks again, Nick -- You received this message because you are subscribed to the Google Groups "Django users" group.

How to implement this model

2010-06-16 Thread Nick
OK, here's the deal. I'm working up an obituary site. There are 3 models/tables and at one point I need to connect two in a way that is different than I have done up to this point. Here is the situation, any recommendations on how to accomplish this would be great: I have an obituary table. In tha

Re: How to create the model in a different database from within the same database server.

2010-06-16 Thread Nick
Which version of django are you working with? On Jun 16, 2:28 pm, thusjanthan wrote: > Hi, > > when I mean database I mean the separate databases from within one > mysql database server. So ex: > > DB server: server.example.com > Databases that are contained in the one instance of mysql: > People

Re: How to implement this model

2010-06-16 Thread Nick
a model form of the obit model: I would like to change the on_premises field to lookup of the two business type fields in the FullProfile model so that the user can select which business type they want to attach to the individual obituary. So if a business has bus_type = Funeral Home and bus_type

Re: How to implement this model

2010-06-16 Thread Nick
>         return self.related_premise is not None >     def get_related_premise(self): >         assert self.on_premise() >         return self.related_premise > > On Jun 16, 3:39 pm, Nick wrote: > > > OK, here's the deal. I'm working up an obituary site.

OR operator in django view

2010-06-18 Thread Nick
How would I write this conditional statement in a view? if not candidate.office_type == "USREP" or "USSEN" or "DJ" or "ASSOCDJ": office = '%s' % (candidate.office_type_description) else: office = [] As is stands, it doesn't seem to be running through all of the OR operato

Re: OR operator in django view

2010-06-18 Thread Nick
Brilliant, thanks On Jun 18, 4:08 pm, Dennis Kaarsemaker wrote: > On vr, 2010-06-18 at 14:04 -0700, Nick wrote: > > > How would I write this conditional statement in a view? > > >     if not candidate.office_type == "USREP" or "USSEN" or "

URL configuration

2010-07-06 Thread Nick
I currently have several django projects on one server. I am working with subdomains for some of these projects and I'd like the base URL to be a little different than the default behavior. I am working with modwsgi and apache. I have a project called MyProject. I have a subdomain set up at mypro

Query raises a DoesNotExist error

2010-07-07 Thread Nick
I am working on a form to resend an account activation email for newly registered users who did not receive their first email. The form is currently raising a DoesNotExist error and I can't figure out why: Here is the activation code: class resend_activation(forms.Form): email = forms.EmailF

Re: Query raises a DoesNotExist error

2010-07-07 Thread Nick
A lot of this is me trying to find out why it's failing. The problem I'm getting is that there is a FullProfile associated with the email address. When i go through the steps in the shell it works perfectly. When I run it through the form it throws an error. If you look at the custom ValidationErro

__init__ custom form validation

2010-07-12 Thread Nick
I am working on a validation that will require a field be filled in if it is another field enters on of three values: For example: I have a form class myform(forms.Modelform): field1 = forms.CharField field2 = forms.Charfield field3_type = forms.CharField(choices=choices) field3

Re: Trouble writing a view for a model

2010-07-12 Thread Nick
I think a choice field is probably best, then you can customize the presentation in a forms file. class Question(models.Model): q_cjoices = ( ('choice1', 'choice1'), ('choice2', 'choice2'), ('choice3', 'choice3'), ('choice4', 'choice4'), ('choice5', 'choice5'), ) title

formatting values list

2010-07-21 Thread Nick
u'type2) etc. etc. How can I format a values_list so I could return something like a table or csv? so: id, name, type id2, name, type etc. etc. Thanks for the help Nick -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: formatting values list

2010-07-21 Thread Nick
Perfect, thanks On Jul 21, 4:50 pm, n3ph wrote: >  Definitely the better way.. > > On 07/21/10 23:42, Franklin Einspruch wrote: > > > Nick, > > > I think you're looking for this: > > >http://docs.djangoproject.com/en/dev/howto/outputting-csv/ > > &

using the update() method

2010-07-21 Thread Nick
I am trying to loop through a queryset and assign values to a field based on other values in that entry. So something like this readers = Readers.objects.filter(status=active) for reader in readers: library = reader.library book = reader.book readers.update(sorter="%s%s" % (lirbary, boo

values() returning more than values

2010-07-21 Thread Nick
I may be misunderstanding the values method but it is returning duplicate results when I use the distinct method. I have a query that pulls the values of a column: Readers = Readers.objects.values_list('organization').distinct() The count returns 189 results but when I send it to output to a csv

Re: values() returning more than values

2010-07-21 Thread Nick
ul 21, 10:47 pm, Kenneth Gonsalves wrote: > On Thursday, July 22, 2010 09:10:31 am Nick wrote: > > > Readers = Readers.objects.values_list('organization').distinct() > > > The count returns 189 results but when I send it to output to a csv it > > returns all of

Re: values() returning more than values

2010-07-21 Thread Nick
eeing multiple duplicate organizations. On Jul 21, 10:47 pm, Kenneth Gonsalves wrote: > On Thursday, July 22, 2010 09:10:31 am Nick wrote: > > > Readers = Readers.objects.values_list('organization').distinct() > > > The count returns 189 results but when I send it to o

Re: using the update() method

2010-07-22 Thread Nick
ant can be accomplished by: > > from django.db.models import F > > readers = Readers.objects.filter(status=active) > readers.update(sorter=(F('library') + F('book')) > > > > On Wed, Jul 21, 2010 at 19:40, Nick wrote: > > > I am trying to loop th

Re: values() returning more than values

2010-07-22 Thread Nick
This is still an issue I'm seeing. I don't know how it can return the proper count but then when i request the actual values it spits out 9 times as many On Jul 21, 11:08 pm, Nick wrote: > It looks like its returning every organization instance in the table, > > There are abou

modelformset vs. inlineformset vs. DIY

2010-07-23 Thread Nick
I have inherited a project with a tight deadline and I am lost for how to proceed. There are two tables: Canididates and Race. The race table holds 145 different races with information about precincts, winners of different stages of the race (primary, runoff, gneral) The Candidates table has 110

Custom admin input app

2010-07-26 Thread Nick
Has anyone heard of, see, or used an app that would transform the table view of the admin into a data entry point, basically jumping the need to click through to individual entries in order to edit them? -- You received this message because you are subscribed to the Google Groups "Django users"

Re: Custom admin input app

2010-07-26 Thread Nick
Completely missed that section. You are always very helpful, Daniel. Thank you. On Jul 26, 10:08 am, Daniel Roseman wrote: > On Jul 26, 3:56 pm, Nick wrote: > > > Has anyone heard of, see, or used an app that would transform the > > table view of the admin into a data entr

save a values_list to a charfield

2010-07-27 Thread Nick
I am needing to do some duct taping for a project that is going on right now. In it I need to take a values_list of id's from a ManyToMany field and save those values to a varchar field so a mysql query can access the values. I am working with two different sets of developers and this is the best w

Re: save a values_list to a charfield

2010-07-27 Thread Nick
I am getting this to save but I can't get it to output properly it's outputting as [16L, 451L, 521L] for a list of id's, which it should according to documentation. However, how can I output it like this 16, 451, 521 On Jul 27, 12:11 pm, Nick wrote: > I am needing to do some

Re: save a values_list to a charfield

2010-07-27 Thread Nick
e the help. On Jul 27, 2:49 pm, ringemup wrote: > ', '.join(primary_ids) > > The fact that you're doing this with foreign keys, though, suggests to > me that you may have a database normalization problem. > > On Jul 27, 3:26 pm, Nick wrote: > > > I

updating admin values with other fields

2010-07-27 Thread Nick
I have a save override in my admin file that catches a value from one field and applies it to another. The values it grabs from a manytomany field. I can get it to work, but only when I save twice. It looks like it needs the manytomany to update with the new values and then it needs to second save

Override queryset for admin Inline

2010-08-06 Thread Nick
I have an admin set up with three inlines. I would like to filter the inline's editable options by a variable that is defined in a settings file. I can over ride the actual admin pieces for each of the inlines (they all have full admin screens of their own). But I can't seem to get the standard d

Re: django-tables with ID

2010-08-10 Thread Nick
You could just write the table out in full in the template and use JavaScript to sort the rows. On Aug 10, 2:55 pm, "Mike W." wrote: > Hi, > > I'm trying to use django-tables to display the output in a grid-like > view.  I'd like a user to be able to choose a row and send it to a > detail page.

Re: forms tutorials

2010-08-11 Thread Nick
The best option would be to break off of the tutorials for a bit and try to build something out on your own. The documentation for forms is quite extensive. I recommend getting comfortable with inlines and formsets http://docs.djangoproject.com/en/1.1/topics/forms/ On Aug 11, 1:39 pm, Jagdeep S

Re: overwrite the save method

2010-08-11 Thread Nick
You override the save in two places, in the form itself or in the view. Either one would work, you could combine the two as well. the form save override would look something like def save(self): formatform = super(FormFormat, self).save(commit=False) if formatform.boolean1 and formatform.

Re: filter users by group

2010-08-11 Thread Nick
You can subclass the User admin and then unregister the default admin and register your new subclassy admin (subclassy is a word) in admin.py: from django.contrib.auth.admin import UserAdmin from django.contrib.auth.models import User class MyNewUserAdmin(UserAdmin): list_filter = UserAdmin.

Re: dynamic forms and custom methods

2010-08-11 Thread Nick
Are you trying to create a save function that evaluates all the weights and returns an error if they are more than 1? On Aug 10, 3:17 pm, lingrlongr wrote: > I 'm trying to create a form dynamically.  This works just fine, but > there's no way for the form to offer any customized validation, by w

Re: dynamic forms and custom methods

2010-08-12 Thread Nick
. On Aug 12, 9:30 am, Steve Holden wrote: > On 8/12/2010 8:36 AM, lingrlongr wrote: > > > > > Hi Nick, > > > Thanks for the reply.  Yes, the department weights will be used in a > > grading scheme.  One department may be 25% (0.25), etc...  But in the > > end

Django psycopg2 installation issue

2010-08-13 Thread Nick
This is actually related to psycopg2, OS X and Postgres but I was hoping someone in here has seen the same issue. I recently installed PostgresPlus 8.4, Django dev (1.4?), and psycop2 version 2.2.0 on my imac OS X 10.6.4 When i try to run dbshell from the command line I get an error that reads r

Re: django queryset get only one result for one column pair

2010-08-14 Thread Nick
http://docs.djangoproject.com/en/dev/ref/models/querysets/#distinct Distinct() may be what you're looking for to returns distinct values for each problem. Or, petter yet, you could use .latest() So Submission.objects.all().latest('problem').distinct() http://www.djangoproject.com/documentation/

Re: query evaluation problem

2010-08-16 Thread Nick
How about using an autofield? http://docs.djangoproject.com/en/dev/ref/models/fields/#autofield On Aug 16, 12:25 pm, Alec Shaner wrote: > Regarding your issue with get_next, could be because you're invoking the > method when you define default=get_next(). Try it with just the bare method > name

Foreignkeys and variables in a view

2010-08-16 Thread Nick
I have a view that handles elections/races. That view takes a request object and then based on that object sends the information to a specific template. For each election/race there is a subset of candidates based on the initial candidate_set from that race. I would like to know how to filter that

Re: Foreignkeys and variables in a view

2010-08-17 Thread Nick
Thanks, Steve. I'll implement this today and see what happens. On Aug 16, 9:46 pm, Steve Holden wrote: > On 8/16/2010 10:30 PM, Nick Tankersley wrote:> Thank you again for your > replies. They've been full of usefull > > information about how to clean up an otherwise

Re: Foreignkeys and variables in a view

2010-08-17 Thread Nick
This appears to be working. Thanks a lot Steve, I really appreciate the help. On Aug 17, 9:07 am, Nick wrote: > Thanks, Steve. I'll implement this today and see what happens. > > On Aug 16, 9:46 pm, Steve Holden wrote: > > > On 8/16/2010 10:30 PM, Nick Tankersley wrot

Re: How to create custom form widgets ?

2010-08-18 Thread Nick
Here's an example: http://joshourisman.com/2008/11/19/custom-fields-and-widgets-django-forms/ Another good way to go would be to look at the django widgets in the source code and follow their example On Aug 18, 1:44 pm, ydjango wrote: > I am using a 3rd party javascript library with some custo

Re: adding a summary field to a model

2010-08-19 Thread Nick
You need to look at overriding the model's save method in order to add data from one field to another dynamically. http://docs.djangoproject.com/en/dev/topics/db/models/#overriding-model-methods On Aug 19, 2:03 am, djnubbio wrote: > Sorry for wasting your preciuose time. I'm very newby in dja

  1   2   3   4   5   6   7   >