Re: Model "created_by"

2011-07-13 Thread Nick Serra
That error just means you didn't add that field to the database and it can't find it. Verify the user_id field is on that table. On Jul 13, 2:40 pm, Petey wrote: > Hi! > > I've made a model in news application:http://pastebin.com/49VkFT14 > > I want it to save user who created a message, however

Multiple Databases

2011-07-05 Thread Nick
single model (think of these as customer specific databases). I will be using sqlite and want to save the path/ connection details of the dynamically created databases in one of the primary db's. Is this possible and if so what is the best approach to take? Thanks Nick -- You received thi

UpdateView help

2011-06-20 Thread Nick
UpdateView.as_view())) 1) What do I do to get from the URL responder into the class- based view, to tell the view what object I want to edit? 2) Why do I get a "name 'get_object' is not defined" error when I run this code? Thanks!! Nick -- You received this message bec

I18n on, l10n off, but django still translating date field

2011-05-26 Thread Nick Serra
Hey everyone, thanks for looking. I am developing a site that has spanish translations. I18n is working properly, but when I switch to spanish, my form output that has dates is in spanish. This is a problem because I am sending out staff emails on some forms, which cannot have spanish in them. So I

Re: my models are remembering old fields that I have since deleted

2011-05-07 Thread Nick Arnett
On Sat, May 7, 2011 at 6:50 PM, George Silva wrote: > Just drop the old tables and run syncdb again! I didn't think it was safe to assume that he wanted to throw away all of his data... Nick -- You received this message because you are subscribed to the Google Groups "Django

Re: my models are remembering old fields that I have since deleted

2011-05-07 Thread Nick Arnett
en copy the old data into the new tables and delete the old tables. If by "flushed" you mean you deleted the old tables (or the whole database), then something else is going on. Nick -- You received this message because you are subscribed to the Google Groups "Django users"

Re: Strange problem with admin, ManyToMany and DEBUG=False

2011-05-02 Thread Nick
ks! :) Is this a bug I've just stumbled across, or should admin.autodiscover() always be after models are imported in urls.py? 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 dja

Re: Strange problem with admin, ManyToMany and DEBUG=False

2011-05-02 Thread Nick
Hi, Yes sorry that wasn't clear. There is basically: page = get_object_or_404(models.Page, slug=level0) which varies depending on the number of "level" arguments passed into the view. So "page" will always be a lookup of a Page object. Thanks, Nick On May 2, 11:05 

Strange problem with admin, ManyToMany and DEBUG=False

2011-05-02 Thread Nick
ad the code between test attempts. I've tried embedded mode and restarted Apache just incase the changes weren't being loaded properly, but this gives the same behaviour. I'm using Django 1.2.5. Thanks, Nick -- You received this message because you are subscribed to the Google Grou

Re: admin login fails

2011-04-19 Thread Nick Stinemates
On Tue, Apr 19, 2011 at 5:36 PM, pfc wrote: > I did try to delete the db and yes I had to create a new superuser > after, however this did not fix the problem. I also reset the db from > the command-line and same result. > Also, it is not a capslock issue, first thing I checked ;-) > The only th

Re: Best Practice for Raw SQL

2011-04-13 Thread Nick Arnett
on.commit_unless_managed() I'm doing a lot of that right now to vastly speed up a huge data import. 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@googlegroups.com. To uns

Looking For A Solid Learning Tutorial

2011-04-13 Thread Nick Hird
solid application step by step and see a finished working site and then take off and customize it on my own. I just haven't found any such tutorial. Thanks, --Nick -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this gr

Accessing object ID in override of model save()

2011-04-01 Thread Nick
Is there a way to access what the ID of a new object being created in the admin? so if you wanted to ovveride the save and then do a get_or_create on another object in another model with a foreignkey back to the object you are creating you would have that ID at your disposal. -- You received thi

Re: idiotic foreignkey error

2011-03-31 Thread Nick
I needed to declare fk_name in the inline formsets. I still stand by the fact that it's an idiotic error message. Not helpful at all. On Mar 31, 2:26 pm, Nick wrote: > sorry, they have unique names. When i was writing this message out I > messed them up. the names are arace, brac

Re: idiotic foreignkey error

2011-03-31 Thread Nick
sorry, they have unique names. When i was writing this message out I messed them up. the names are arace, brace and crace. I think this has something to do with some relic inlinde formsets I was using a while ago. On Mar 31, 2:19 pm, Shawn Milochik wrote: > They need unique related_name values.

idiotic foreignkey error

2011-03-31 Thread Nick
I have a model with 3 foreignkeys to another model. This has never been an issue for me before but now it's throwing an error: has more than 1 ForeignKey to My model looks like this: a_race = models.ForeignKey('Race', related_name='arace', blank=True) b_race = models.ForeignKey('Race', related

Re: inlineformset_factory default values

2011-03-30 Thread Nick
ave() return HttpResponseRedirect('') else: formset = CampaignFormSet(instance=r) here is the template {% for form in formset %} {{form.name.value}} {{form.party}} {{form.vote}} On Mar 30, 1:14 pm, Nick wrote: > I am using inlineformsets_factory on a form and eve

inlineformset_factory default values

2011-03-30 Thread Nick
I am using inlineformsets_factory on a form and every time I save those fields that are not made available in the form are overridden to null values on save. How do i get it just to update those fields that are specifically listed in the form? -- You received this message because you are subscri

Re: Accessing values in formset loops

2011-03-29 Thread Nick
I guess the bigger question is, can I access the values of the fields without spitting out a form field? On Mar 29, 2:45 pm, Nick wrote: > I am looping through a formset and attempting to add an additional > field to the form that is a multi select checkbox that has a value of > the

Accessing values in formset loops

2011-03-29 Thread Nick
I am looping through a formset and attempting to add an additional field to the form that is a multi select checkbox that has a value of the ID of the current iteration of the formset loop. So: model1: name = CharField ID = IntegerField FK = ForeignKey('model2') model2: name my for

Re: extend User Model for custom fields

2011-03-25 Thread Nick Serra
Andre's solution is out of date. Calvin is correct, use the user profile model that is built into django auth. OP, the link you found is correct. On Mar 25, 11:39 am, Andre Terra wrote: > This is the correct way: > > http://www.b-list.org/weblog/2006/jun/06/django-tips-extending-user-m... > > Sin

Re: A little help before I run down the wrong rabbit hole

2011-03-15 Thread Nick
Thanks, Shawn. That was the first question I had. There will likely be more to follow but I didn't want to chase the wrong solution from the start. On Mar 15, 3:02 pm, Shawn Milochik wrote: > You can use formsets, which can be passed querysets upon > initialization. If this doesn't help, feel fre

A little help before I run down the wrong rabbit hole

2011-03-15 Thread Nick
I am working on an election application. I am at the point where I would like to start putting together the data entry point for the app and would like a little advice on how to proceed. Here is a (simplified) version of my models: class Candidate(models.Model): f_name = models.CharField()

Re: Google app engine django 1.2 localization

2011-03-12 Thread Nick Rosencrantz
Many thanks for the idea! I'll try the setup you're referring to. Regards, Nick Rosencrantz On Mar 12, 9:48 am, Jiten Singh wrote: > Hi Nick, > > While working with GAE I use django provided onhttp://allbuttonspressed.com, > it is django non rel i know you must > have h

Google app engine django 1.2 localization

2011-03-12 Thread Nick Rosencrantz
ale/LANG_CODE/LC_MESSAGES/django.po It still won't work. I'm considering why and welcoming any more advice or recommendation how to enable i18n features with django for google app engine. If any know-how is on this issue then kindly instruct here how to proceed. Regards, Nick Rosencr

Re: django 1.2 + Google app engine + templatetags

2011-03-07 Thread Nick Rosencrantz
Solved. -- 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 gr

Override AdminAuthentication form for custom auth in Django Admin

2011-03-03 Thread Nick Serra
Hey everyone, thanks for looking. Running into a problem getting the Django Admin working with a custom auth system. Have everything working, but I cannot get the admin to use my custom auth app to login. I am not running a custom auth backend, but an entirely different auth app in my project. Bas

Populating charfield with ID's from many to many

2011-03-01 Thread Nick
I am trying to populate a CharField with id's from a many-to-many field. I am doing this by overriding the save method on the model save and using the default django admin for data entry, however, it requires 2 saves in order to get the data from the many-to-many field to populate the varchar fiel

Re: Django Job Opportunity at IDLE GAMES (The Social Game Changers)

2011-02-23 Thread Nick Arnett
On Wed, Feb 23, 2011 at 12:35 PM, Aliciasf wrote: ...and (iv) the Tempting system... > That's the whole thing, isn't it? ;-) Nick -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, sen

Android mail? (Re: [tueysuezseftali:76683] [android-developers] Select mp3 to play?)

2011-02-17 Thread Nick Arnett
Anybody on django-users know why this mail is coming to our group? It's strange - the "To" header is android-developers, but the reply-to is django-users. I can't quite tell if it is a Google Groups problem or the person posting ( nikola1...@gmail.com). Nick On Thu, Feb

Re: View file not processing any new additions

2011-02-09 Thread Nick
Nevermind. I was checking the template for one view and editing another. Idiotic. yeesh. On Feb 9, 12:12 pm, Nick wrote: > Additionally, > > if I change any of the other elements in the view, say: es = > ExamplTESTFORFAULT.object.all() it doesn't raise an error. Only when &g

Re: View file not processing any new additions

2011-02-09 Thread Nick
Additionally, if I change any of the other elements in the view, say: es = ExamplTESTFORFAULT.object.all() it doesn't raise an error. Only when there is a syntax error. On Feb 9, 11:53 am, Nick wrote: > I have a view for an application that loops through a queryset and > cleans the

View file not processing any new additions

2011-02-09 Thread Nick
I have a view for an application that loops through a queryset and cleans the data for a certain kind of output but leaves all the DB data in tact as it was entered for archiving purposes. There are multiple conditional checks that are working fine but anything new I've added or subtracted from the

Re: Django API efficient enough for filtering tens of millions of records?

2011-01-18 Thread Nick Arnett
ing a bulk insert to load into the database. Bulk inserts will be FAR more efficient than using Django. 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@googlegroups.com. To unsubs

Re: automated testing: how to generate human-verifiable views?

2011-01-04 Thread Nick Stinemates
hat others think. Nick On Tuesday, January 4, 2011, Jennifer Bell wrote: > Hi, > > I'm trying to figure out the best way of doing something I'd like > to partially automate staging testing by generating a sequence of > human verifiable views, with the goal of making

string format date in query

2010-12-29 Thread Nick
I am using a little raw SQL to pull out a count of events by month. I am able to retrieve the correct information but am getting the month value in numerical form rather than an actual name. So instead of January I get a 1. Here is query: dates = markers.extra(select={'month': 'month(date)'}).valu

Re: Full text indexing in small site

2010-12-26 Thread Nick Arnett
SQL, its indexing is probably sufficient. You'll need to store your text in a MyISAM table to do so. 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...@googlegroups.com. To unsubsc

Re: Creating initial Security/Auth objects with syncdb

2010-12-22 Thread Nick Serra
Could just put the group in the initial data for sync db. Look up django fixtures. It will load data into the database from a json feed on syncdb. On Dec 21, 1:50 pm, "Mark (Nosrednakram)" wrote: > Hello, > > I would like to install an auth_group with my application and am > considering using the

Re: English translation for error message?

2010-12-22 Thread Nick Serra
http://translate.google.com/#auto|en|%20list%20index%20out%20of%20range On Dec 21, 6:10 pm, Bill Freeman wrote: > On Tue, Dec 21, 2010 at 5:53 PM, Jonathan Hayward < > > > > > > christos.jonathan.hayw...@gmail.com> wrote: > > [jhayw...@cmlnxbld01 invdb]$ python manage.py shell > > Python 2.7 (r27

Re: Problem with simple file upload.

2010-12-22 Thread Nick Serra
I'm too lazy to check, but i'm pretty sure the name of your file input needs to match the name of the form field. Also, try troubleshooting. Use print statements in the view to see if the file object is being posted, etc. On Dec 21, 11:54 pm, vivek_12315 wrote: > Awaiting reply! > > On Dec 22, 3:

Re: Serialize Data for JSON output

2010-12-20 Thread Nick
This sounds like it is an issue with your JS for your carousel. If you are needing to get your JSON directly into your JS code then you can just make gallery_thumbs_json_s list as a variable {'caro_list': gallery_thumbs_json_s} and then just call it in your template On Dec 20, 9:16 am, Dave Saye

redirecting on SMTP error

2010-12-20 Thread Nick
I have an app with some SMTP errors that are getting tricky. Our network team is working on our email servers for the next few days and it is affecting the auto-notifications portion of the app. Right now i am getting a 550 'relay not permitted' error. How can I trap this error and redirect upon e

Admin inline adding one too many extra rows to the form

2010-12-14 Thread Nick
I have three models. Two are inlines of another model in the Admin. I have their extra parameters set to 0 so: class model1(admin.StackedInline): model = Model1 extra = 0 class model2(admin.StackedInline): model = Model1 extra = 0 class model3(admin.ModelAdmin): inline = [

Conditional inline for django admin

2010-12-13 Thread Nick
I am working with an app that has several different models that are connected to a central model via a ForiegnKey. I'd like to display a certain inline based on a value from the central model. Ex. model1 some_field central = ForeignKey(CentralModel) model2 some_field central = ForeignKey(Centra

Re: Create new entry on first save of different model

2010-12-09 Thread Nick
Nevermind. I think I got it. On Dec 9, 3:57 pm, Nick wrote: > Thanks for the reply. I'm working on the override. How to I affect a > model from the save of another model. > > On Dec 9, 3:37 pm, Ilian Iliev wrote: > > > Hi, > > > you can overload the save me

Re: Create new entry on first save of different model

2010-12-09 Thread Nick
el2. > > -- > eng. Ilian Iliev > Web Software Developer > > Mobile: +359 88 66 08 400 > Website: ilian.i-n-i.org > > On Thu, Dec 9, 2010 at 11:21 PM, Nick wrote: > > I am working on a project in which I need to evaluate a field in one > > model and based on its va

Create new entry on first save of different model

2010-12-09 Thread Nick
I am working on a project in which I need to evaluate a field in one model and based on its values add entries to another model. I don't quite now how to succinctly put that into words which is why searching for a solution has been so annoying. Here is my example Type_Choices = ( ('Person', '

Re: Key 'buscar' not found in "

2010-11-25 Thread Nick Arnett
nk targets to > "http://localhost:8000/search/?page=2"; > instead of something like this: > "http://localhost:8000/search/?option_value1=7&option_value2=3&page=2"; > There is any way to maintain the searchred url and indicate wich is > the next page? You nee

Re: CI

2010-11-16 Thread Nick Lo
Hi Johannes, You may be interested in this project: https://github.com/kmmbvnr/django-hudson Cheers, Nick On Nov 14, 5:36 am, Johannes Nel wrote: > answering my own questions here: > > By the looks of things I will stick with hudson for now, I found some > information on cover

Excessive tmp table creation for mysql

2010-11-09 Thread Nick
Yesterday I received a warning from our DB monitoring system stating that my django DB had an excessive amount of temp tables created. Here is the error: * Nagios 2.10 * Notification Type: PROBLEM Service: mysql_tmp_disk_tables Host: Address: State: WARNING Date/Time: Mon Nov 8 15:19:18

Re: Manual ordering

2010-10-20 Thread Nick
Worked like a charm. This was a limited case so I won't be needing any checks to ensure that the ID's are all in the queryset since there are only 5 or 6. Thanks again. On Oct 20, 10:44 am, Shawn Milochik wrote: > Given a tuple/list of primary keys named ordered_ids and a queryset named > record

Manual ordering

2010-10-20 Thread Nick
I am working on the output for some data and I would like to manually assign the order as there is no field that I can order by that will give me the desired output. Is there a way to manually declare the order of output based on the PKs of an entry? -- You received this message because you are s

MySQL locking problem

2010-10-14 Thread Nick Arnett
00:00:00', `body` = 'This is the | +-+-+-+---+-+--++--+ Anybody have suggestions for tracking this down? Nick -- You received this message because you are subscribed to the Google Groups "Django users"

Re: What is the best way to implement time-based / cronjob actions in a Django app?

2010-10-13 Thread Nick Arnett
rting *, I usually just import the models I need for that script. I like keeping all that housekeeping stuff separate from the web app. 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-u

Re: Escaping text for raw SQL?

2010-10-12 Thread Nick Arnett
sc(s): > return replace("'", "''") Am I going brain dead, or isn't there more than just quotation marks that need to be replaced? This code is a back-end processing script, so there is no danger of SQL injection by anybody (except me). Nick -- Yo

Re: Escaping text for raw SQL?

2010-10-12 Thread Nick Arnett
On Tue, Oct 12, 2010 at 9:00 AM, Javier Guerra Giraldez wrote: > On Tue, Oct 12, 2010 at 10:46 AM, Nick Arnett > wrote: > > Anybody know a good way to do this? > > Words.objects.filter(foo__in=mylist) Didn't even occur to me to not use raw SQL for this, but I could... tr

Escaping text for raw SQL?

2010-10-12 Thread Nick Arnett
on't see an escape function exposed in Django. Anybody know a good way to do this? TIA, 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...@googlegroups.com. To unsubscribe fro

Re: Full Text Search

2010-10-01 Thread Nick Arnett
On Fri, Oct 1, 2010 at 3:52 AM, Alessandro Ronchi < alessandro.ron...@soasi.com> wrote: > > > On Fri, Oct 1, 2010 at 3:35 AM, Steve Holden wrote: > >> On 9/30/2010 8:26 PM, Nick Arnett wrote: >> > Brain is mush, though. >> >> > Thank you.

Re: Full Text Search

2010-09-30 Thread Nick Arnett
g client, involving Django/MySQL full text and parametric search and they loved it... so it's on my mind. If you don't get a real answer by tomorrow afternoon, I may be conscious again then. You have to use one of the alternative approaches to search, as I recall. Brain is mush, though. Ni

Re: problem with saving a form

2010-09-27 Thread Nick Serra
You're just all around doing it wrong. A ModelForm is used so that you don't have to individually list all the fields you need, it is based off the model. What is the code for your Model? And also, I'd reread the form reference from the start. On Sep 26, 5:25 pm, Marc Aymerich wrote: > On Sun, Se

Re: Universal form

2010-09-24 Thread Nick Arnett
your users aren't allowed to see any page without logging in. See http://www.mail-archive.com/django-develop...@googlegroups.com/msg06473.html <http://www.mail-archive.com/django-develop...@googlegroups.com/msg06473.html> Nick On Fri, Sep 24, 2010 at 8:23 AM, Tran Cao Thai wrote:

Why does extending a class create so much overhead?

2010-09-19 Thread Nick
I'm still a newbie to django but I think I want to start working on my first real project and I'm kind of confused about extending another application's features without creating overhead. I started to investigate flat pages because I planned to have a few flat pages however I wanted to add a few

Re: Django and third party python apps, best practices for path locations?

2010-09-15 Thread Nick
to get around to setting it up and learning how to use it. On Sep 15, 11:01 pm, Mike Dewhirst wrote: > On 16/09/2010 12:06pm, Nick wrote: > > > Yes and no. I'm familiar with the term but haven't read up on it > > enough to wrap my head around installing it and getti

Re: Django and third party python apps, best practices for path locations?

2010-09-15 Thread Nick
On Sep 15, 9:50 pm, "nick.l...@gmail.com" wrote: > Nick, > > yes...and no. > > Have you looked at using Virtualenv?http://pypi.python.org/pypi/virtualenv > > On Thu, Sep 16, 2010 at 1:44 AM, Nick > > > > > > wrote: > > Let's say you have

Django and third party python apps, best practices for path locations?

2010-09-15 Thread Nick
Let's say you have Python installed to D:/dev/python2.6 Is it wise/common practice to put django and other third party python libraries (like pygments or markdown) in the python2.6/Lib/site- packages/ directory while putting your actual projects in a completely separate location off the python pat

Re: syncdb problem - windows, sqlite

2010-09-15 Thread Nick
This seems to happen when you specify an incorrect path to the database in NAME. Fix: Use the correct path. :D It looks like you spelled 'frameworks' incorrectly. On Sep 15, 12:03 pm, Aju wrote: > Hi, > > I am using the Django tutorial (Windows xp, python 2.5.4, django 1.2.3) and > am facing a

Re: Tools to ease template/ui development

2010-09-15 Thread Nick
I would go with PyCharm. Unfortunately it's not free but for $49 I don't think you'll find anything better. It has really solid template highlighting and code complete along with the best Python/Django support I've seen yet. I'm still new to Django but I did spend a fair bit of time looking for an

Re: contrib.comments, admin section [unable to see comments]

2010-09-14 Thread Nick
;s worst nightmare. On Sep 14, 8:19 pm, Karen Tracey wrote: > On Tue, Sep 14, 2010 at 12:52 PM, Nick < > > > > > > iregisteratwebsiteswitht...@gmail.com> wrote: > > Hello, > > > I tried to troubleshoot this with Google and #django on IRC but I'm > >

contrib.comments, admin section [unable to see comments]

2010-09-14 Thread Nick
Hello, I tried to troubleshoot this with Google and #django on IRC but I'm coming up empty. I've been following the practical django projects second edition book using django 1.2.3 on a local server. I have added 'django.contrib.comments' to my settings file + adjusted my urls.py file just like t

Re: prepopulated_fields problem (+admin CSS issues)

2010-09-14 Thread Nick
erent titles. As for my second question. Can you not help because you haven't experienced this issue, or is it something you just don't have a problem with? On Sep 14, 11:20 am, "nick.l...@gmail.com" wrote: > Nick, > > I can answer you first question...but not reall

prepopulated_fields problem (+admin CSS issues)

2010-09-14 Thread Nick
a 1600 width screen and 3 or 4 columns are shrunken to 75-100 pixels wide with a 1000 pixel white space before it shows the sidebar. 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 djan

Re: Strange problem accessing JS for admin

2010-08-25 Thread Nick Tankersley
Steve Holden wrote: > On 8/25/2010 9:54 AM, Nick wrote: > > Stranger still, I can get to the /media/js/admin/ > > RelatedObjectLookups.js but not the jquery library > > > > > > On Aug 24, 4:51 pm, Nick wrote: > >> I have a model set up to use collapsable inl

Re: Strange problem accessing JS for admin

2010-08-25 Thread Nick
Stranger still, I can get to the /media/js/admin/ RelatedObjectLookups.js but not the jquery library On Aug 24, 4:51 pm, Nick wrote: > I have a model set up to use collapsable inlines but for some reason > the path to my js files is acting very strange. > > I can find the co

Strange problem accessing JS for admin

2010-08-24 Thread Nick
I have a model set up to use collapsable inlines but for some reason the path to my js files is acting very strange. I can find the core.js at http://mysite.com/media/js/core.js but when i try to reach any other js http://mysite.com/media/js/inline.min.js I get a server error "/media/js/inlines.

Re: manage.py syncdb not working

2010-08-24 Thread Nick Arnett
ld table manually to match how Django would have done it automatically (and then drop the temporary table). 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...@googlegroups.com. To uns

Re: Stucked in Tutorial 3

2010-08-22 Thread Nick
the problem is on the return HttpResponse (t.render(c)) line. Check that your indentation is correct On Aug 22, 9:51 am, craphunter wrote: > Hi, > > I am very new in Django and Python. I am stucked in Tutorial 3 in part > "Write views that actually do something". > > I don't get it to run the ind

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

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: 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: 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: Ordering in the admin

2010-08-16 Thread Nick Serra
trying to match the id. > > I'm going to read about filtering a little more, feels like it's > close... > (I also tried to put film_id in the parens after filter and got a "too > many values" error.) > So much to learn, thanks

Re: Ordering in the admin

2010-08-16 Thread Nick Serra
gt;                         {% for filmmaker in filmmakers %} >                            {% if filmmakers|length > 2 and not forloop.first > %}, {% endif > %} >                            {% if forloop.last and not forloop.first %}and {% > endif %} >                               {{filmmake

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: Ordering in the admin

2010-08-16 Thread Nick Serra
bject has a first name and last name. > I'm not sure where to start on this one, any help would be greatly > appreciated. > Thanks, > Wendy > > On Aug 16, 12:45 pm, Wendy wrote: > > > > > Thanks, Nick, I just figured that out, doh!  So I got the first > > exa

Re: Ordering in the admin

2010-08-16 Thread Nick Serra
: > Thanks Nick, > I tried the first solution first. > You're right, the many to manys aren't editable on that page, but the > problem is, I'm not seeing another admin page for the new join model: > > class FilmmakerPosition(models.Model): >          fil

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

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/

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: How to check for m2m orphans before deleting an object?

2010-08-13 Thread Nick Serra
Look into the clear() method on many to many relations. Calling .clear() before a delete will remove all relations between the models and allow you to delete the category only. You might be fighting the django admin on this though, so this would be best implemented in a custom solution. Not sure if

Re: Ordering in the admin

2010-08-13 Thread Nick Serra
You can go two directions with this. First, you could use a intermediate model for the many to many join, which would allow you to specify extra field on the join, in this case the order. Read up on this here: http://docs.djangoproject.com/en/dev/topics/db/models/#extra-fields-on-many-to-many-relat

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

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: 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: 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: 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: 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: I did something wrong while registered

2010-08-09 Thread Nick Arnett
looked at the headers of a pair of messages to see if you are receiving them on different email addresses? If so, just unsubscribe with one of them. If not, well, you need further help! Nick -- You received this message because you are subscribed to the Google Groups "Django users&quo

Re: Querying in a loop - cached results?

2010-08-08 Thread Nick Arnett
c06dfor >> more explanation. > > Ah, I didn't think of that. Didn't even think about the fact that there are transactions going on behind the curtain. I'll look into that. Nick -- You received this message because you are subscribed to the Google Groups "Django

Re: Querying in a loop - cached results?

2010-08-08 Thread Nick Arnett
On Sun, Aug 8, 2010 at 11:52 AM, Daniel Roseman wrote: > > > Where is this query running - in a view, or an external script? And > how is the data being added to the db? In both cases -- adding data and analyzing -- it is an external script, using the Django ORM. Nick -- You r

Querying in a loop - cached results?

2010-08-08 Thread Nick Arnett
he loop, but that didn't help - thought maybe if I explicitly deleted the data, that would work. Any ideas what's going on or how to solve this? TIA, Nick -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

<    1   2   3   4   5   6   7   >