Re: Suggested approach for a date based form layout

2008-09-30 Thread Nick Lo
Hi Gerard, Actually part of my solution was and is using modelform but that was really just for the convenience of save(). I've got a solution together now but thanks for your response, Nick > > Nick, > > I'm not a longtime Django user, but I would check de django

Is this a reasonable way to approach a calendar based form(set)?

2008-10-10 Thread Nick Lo
tweaks/missing something crucial/missing the point entirely/etc and if there are any tricks/features/alternative approaches I should consider? With thanks, Nick p.s. Please feel free to mock my code as much as is needed! --~--~-~--~~~---~--~~ You receiv

Re: charts in django

2009-01-29 Thread Nick Lo
to XML/SWF charts with minidom: http://code.google.com/p/open-flash-chart-python/ http://www.maani.us/xml_charts/ Nick --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to t

Re: Django and php can they mix?

2009-02-17 Thread Nick Lo
be php coded into that part of > the site. Any help / advice would be a great help, thanks That question doesn't read very clearly but this may have answers: http://wiki.developers.facebook.com/index.php/PythonPyFacebookTutorial Cheers, Nick --~--~-~--~~~---~-

Re: Typo for Django or Like?

2009-03-17 Thread Nick Lo
g application which is I think what Alex asked originally. A little more detail will probably get you a few more productive responses, Nick > Sure, > > Typo is a blogging platform/cms (Like wordpress). I know about > Django-cms and I am wondering if there are any others? > >

Re: templates in Practical Django Projects

2009-06-21 Thread Nick Lo
eed to have directories as 755 and files as 644 before I have any joy. Cheers, 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

Re: Question IMAGE in Django

2009-06-21 Thread Nick Lo
e: /images/pub/{{ x.id }}-thumbnail.jpg Hope that helps? 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

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

2009-06-23 Thread Nick Day
That worked, thanks. --~--~-~--~~~---~--~~ 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

Re: Practical Django Projects or Pro Django Books

2009-06-24 Thread Nick Lo
ond edition is aimed at Django 1.1. In short, if you can afford it, get both. 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

Getting the name of a matched URL pattern

2009-07-01 Thread Nick Fishman
about this same issue (http://stackoverflow.com/questions/1042211/get-name-for-matched-url-pattern), but the solution requires duplicating the URL pattern name in a dictionary. Thanks, Nick --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Re: Getting the name of a matched URL pattern

2009-07-02 Thread Nick Fishman
our method looks pretty fast. Thanks! Shawn, request.build_absolute_uri() returns a full path like http://hostname/path/goes/here/, but it doesn't tell me the name of the URL pattern that caused the request to be resolved to a particular view. Nick --~--~-~--~~~---~-

Caching template fragments without specifying expiration time

2009-08-02 Thread Nick Fishman
es entries with keys "fragment_name:additional:arguments:seperated:by:colons", so this seems possible. Any thoughts? Nick --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send e

Re: Caching template fragments without specifying expiration time

2009-08-02 Thread Nick Fishman
with setting a large constant in a context_processor and using that as the "effectively expire never" time. I'd have to use a similar trick when using the low-level cache API, anyway. Thanks, Nick --~--~-~--~~~---~--~~ You received this message because you are subs

Re: Security: Django vs popular PHP apps?

2009-09-09 Thread Nick Lo
> I am hoping to get some reasonably knowledgeable, and unbiased, > responses. > > I was thinking about putting together a wordpress blog. Then I came > across a recent slashdot article about recent wordpress security > issues. I did a little research, and found that wordpress has quite a > histor

Re: Problem Installing Django on OS X 10.4.11

2009-04-02 Thread Nick Lo
been installed properly and you'll need to give more info as to what steps you're taking, such as the output from the above. The basic idea is really only that the main django file (the one that contains eg contrib, auth, db, etc.) is in that site-packages directory and therefo

Re: Running django on a web hosting account

2009-04-06 Thread Nick Lo
l of access to your host (shell access for example). If you find your host doesn't provide what you need then you could consider a host that has been recognised for its Django "friendliness": http://djangofriendly.com/ Hope that's a start, Nick --~--~-~--~~---

Igoogle integration

2009-04-09 Thread Nick Boucart
e, to keep it DRY. My first thought was to include a different base.html template when the url of that view was like /embed/ my_url so but I'm not sure if that is the best approach. I hope my question is clear. Any thoughts? Many thanks! Nick. --~--~-~--~~~-

Re: Igoogle integration

2009-04-09 Thread Nick Boucart
ave a urls like: /mycoolfeed and /embed/mycoolfeed that both fetch exactly the same data from the database, but render a different template based upon the url. How would you do this? Thanks! Nick. On Apr 9, 3:57 pm, Nick Boucart wrote: > Hi, > > I'm pretty new to django, so bear

Re: Webpy vs Django

2009-04-22 Thread Nick Lo
is in this old post (2005)... http://www.aaronsw.com/weblog/rewritingreddit ...that compares web.py with Django based on the needs of the project. Choosing between Django and web.py doesn't need to be a mutually exclusive situation. You may use one in one case, the other another. Anyway, I&#

Re: how to work with web service in django

2009-05-18 Thread Nick Lo
mplate. Then since you're going to be making queries to a service that, depending on your network, may or may be available or may be slow, take a look at caching that information. Nick --~--~-~--~~~---~--~~ You received this message because you are subsc

Re: List of available projects

2009-05-18 Thread Nick Lo
te iself ? Aside from the various code repositories; like http:// code.google.com/, http://github.com/, http://bitbucket.org/, http://launchpad.net/ the django site itself has: http://code.djangoproject.com/wiki/DjangoResources Nick --~--~-~--~~~---~--~~ You rece

Re: Any good django book that covers version 1.0?

2009-06-14 Thread Nick Lo
ed (I'm currently reading it): http://www.apress.com/book/view/1430210478 Safari books online: http://my.safaribooksonline.com has a selection of these if you don't mind on-screen reading. Cheers, Nick --~--~-~--~~~---~--~~ You received this message b

Django gives little information about custom raised exceptions

2009-06-15 Thread Nick Fishman
/page/ BADDATA Request Method: GET In the second case, Django catches the last argument, but not the first. But in both cases, it doesn't read my custom string message. Is there any way to display custom error strings, or am I doing something completely wrong? Thanks a ton! N

Re: Scientific Data Frontend with Django

2009-06-17 Thread Nick Fishman
b-in-a-web-application-serverfor anyone who might have similar problems. Nick On Wed, Jun 17, 2009 at 11:08 PM, Vincent wrote: > > That sounds like a great idea. Something i have been meaning to try > for a while but haven't gotten around to. > > For a class website i did t

Re: benefits of {% url %} for breadcrumbs?

2009-09-16 Thread Nick Lo
You might find this useful: http://code.google.com/p/django-crumbs/ >> the only point where DRY comes into play is when you're retrieving >> data from the same view, is there a better way to make breadcrumbs? --~--~-~--~~~---~--~~ You received this message becau

Re: django vps hosts

2009-09-23 Thread Nick Lo
This may be helpful: http://djangofriendly.com/hosts/ > I think I'm ready to finally switch to a django vps host due to > problems with django on DreamHost. Can anyone recommend a good vps > host? --~--~-~--~~~---~--~~ You received this message because you are su

Re: djangocon videos

2009-10-14 Thread Nick Lo
> anybody knows when djangocon september/portland videos will be > available? I expect you'll hear about their availability here first: http://twitter.com/djangocon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Form that updates a list of items?

2009-10-31 Thread Nick Arnett
ust can't quite grok how to put this together. Processing the form means updating the target with the new Boolean values selected by the user in the form, of course. If anybody has an example that does something like this, that'll be great. Thanks in advance, Nick --~--~-~--~~

Legacy database - does every table need an id column?

2009-11-01 Thread Nick Arnett
column to the tables who use the foreign key combination as their primary keys. As I ask the question, it now seems clear to me that the column is needed. Nick --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django

Re: Form that updates a list of items?

2009-11-02 Thread Nick Arnett
e this helps you to find a way to do your multiple items edit form. Ah, that does look helpful and I wondered it I might do better to create one form per line, as it suggests. Nick --~--~-~--~~~---~--~~ You received this message because you are subscribed to th

Where are forms usually defined?

2009-11-03 Thread Nick Arnett
ile called forms.py... but somewhere I'd expect to then see an import statement along the lines of "from mysite.forms import *". If I use forms.py for my forms, where does that file need to be imported? Thanks, Nick --~--~-~--~~~---~--~~ You received thi

Re: Where are forms usually defined?

2009-11-03 Thread Nick Arnett
On Tue, Nov 3, 2009 at 11:26 AM, f4nt wrote: > > forms.py is pretty standard. You'd end up importing them in your > views.py. Thanks... that's what I was guessing. But it appears to me that I sometimes see ModelForms in models.py... wondering if th

Re: form with loop over fields?

2009-11-11 Thread Nick Arnett
umn. The solution looks like this in the template: {% for field in form.visible_fields %} {{ field }} {% endfor %} Now I'm trying to figure out how to get the "year" column data into the form, dynamically from a model. Nick --~--~-~--~~~---~--~~ You

Re: Making the case for Django (vs. Drupal)

2009-11-12 Thread Nick Lo
d and what it doesn't contain it has an ever increasing list of 3rd party solutions that can be used even if temporarily. I could probably go on but I think I need to let sleep have it's way for a change! Cheers, Nick -- You received this message because you are subscribed to the

Re: form with loop over fields?

2009-11-12 Thread Nick Arnett
> of the model) > > and how should i store the values independently from each other? I believe the simple way would be a model that has month and year fields, with a meta method that defines them as unique together. Nick -- You received this message because you are subscribed to th

Re: MySQL error subquery returns more than 1 row

2009-11-17 Thread Nick Arnett
like this: SELECT * FROM `test_mymodel` t1, (SELECT `id` FROM `test_mymodel2`) t2 WHERE t1.id = t2.id 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

Re: MySQL error subquery returns more than 1 row

2009-11-17 Thread Nick Arnett
)))._as_sql()) > and write here output. > Ah, sorry - I was confused... I thought you wrote the SQL yourself. That does seem to be a problem with the ORM. Nick -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to

Set model form initial value?

2009-11-17 Thread Nick Arnett
tial values... but how do I do that with a model form? Or should it be a custom form to do that? Thanks in advance, 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...@googlegro

Re: Set model form initial value?

2009-11-18 Thread Nick Arnett
nwhile, I kludged it by using a loop to generate the choices and "ifequal choice.id selected_project" to insert the "checked" attribute into the appropriate choice, which works. Nice to know the right way, however. Thanks Nick -- You received this message because you are s

Strange debugger behavior

2009-11-19 Thread Nick Arnett
s. Anybody aware of this as a known issue? Any fix? Since I can avoid it by not stepping through the "magic" parts of the database stuff, it isn't critical. Nick -- You received this message because you are subscribed to the Google Groups "Django users"

Can't get form to update, rather than insert

2009-11-23 Thread Nick Arnett
cate ID. Anybody have a working example of a form that updates, rather than inserts? Oh, and forcing an update in the save method doesn't solve the problem. I have no problem performing updates outside of the context of forms - I just can't figure out how to get it to work with forms. Th

Re: Django tag cloud

2009-11-26 Thread Nick Arnett
gine that there's a Python library or module that will do this for you, but it's not hard to write your own. 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

Re: is_valid error/bug when unique_together fields are both ForeignKey fields

2009-11-26 Thread Nick Arnett
rors and either produces no results or some other error. What I think this generally means is that in your view, the object isn't getting initialized for some reason. I'm assuming that you get the error when you try to save. I'd carefully go over whatever initializes or sets t

Re: IDLE (Python GUI)

2009-11-28 Thread Nick Arnett
ports from Django): import os os.environ['DJANGO_SETTINGS_MODULE'] = "settings" (The absolute or relative path to your settings file.) Nick -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to dj

Re: ModelMultipleChoiceField with checkboxes: How to generate the HTML "checked" option?

2009-11-29 Thread Nick Arnett
nyone done this without writing their own widget? It would be > great to know how. > Thank you in advance, > Rather than trying to do that on the client side (which is what I think you're saying), have you considered just passing the required values to the template as context variables?

Re: ModelMultipleChoiceField with checkboxes: How to generate the HTML "checked" option?

2009-11-29 Thread Nick Arnett
easy as passing a dict as "initial" to your form instance you create in the view: form = MyForm(initial = {"foo"=True, "bar"=True} with the field names (instead of foo and bar) of the check boxes you want checked. Your form then should have them checked when it is ren

Re: how to get remote port number

2009-11-29 Thread Nick Arnett
ys is the same as the server port number. Gotta be 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 unsubscribe from this group, send email to django-u

Re: how to get remote port number

2009-11-29 Thread Nick Arnett
desired port. But the client really doesn't care - > it just expects the server to reply to the same port number it sent its > request from. > Of course, but I can't imagine why anybody would ever worry about that at the application level. Nick -- You received this message becau

Re: ModelMultipleChoiceField with checkboxes: How to generate the HTML "checked" option?

2009-11-29 Thread Nick Arnett
odifyProfileForm(initial=initial_dict) Something like your last line might work, but it is a lot more work than just passing the form the initialization dict. Others feel free to jump in here and set me straight as needed. I'm still fairly new to Django, so I'm no expert... but I

Re: A Friendship relationship question.

2009-12-02 Thread Nick Arnett
In other words, at some point when you save a form, you're creating a row like this: rel = Friendship.objects.create(to_friend=user1, from_friend=user2) rel.save() But are you doing the reverse? rel = Friendship.objects.create(to_friend=user2, from_friend=user1) rel.save() There are other ways to accomp

Re: A Friendship relationship question.

2009-12-02 Thread Nick Arnett
go was built for, of course. If you want to scale, really scale, you'll want to use a graph library. There are several for Python, including NetworkX, which I've used, and Boost, which I haven't. Probably more info than you wanted, but there it is. Nick -- You received this message be

Re: Forms - readonly representation?

2009-12-03 Thread Nick Arnett
27;value'] = force_unicode(value) return mark_safe(u'%s' % (forms.util.flatatt(final_attrs),value)) I found it here: http://www.djangosnippets.org/snippets/1185/ Nick (tempted not to respond due to the "deafening silence" comment... did you imagine you're due an i

Re: Forms - readonly representation?

2009-12-03 Thread Nick Arnett
On Thu, Dec 3, 2009 at 2:50 PM, Todd Blanchard wrote: > I'd gotten nearly a dozen responses to a later question so I figured the > threshold of awareness had passed on this one. Never assume correlation implies causation... ;-) Nick -- You received this message because you are su

Re: delete every record in a table?

2009-12-04 Thread Nick Arnett
uch a purpose, which you could sending as a > raw SQL command: Same works for MySQL. And it is far, far faster than most other ways, for large tables. Nick -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Re: Green hosting suggestions for Django?

2009-12-07 Thread Nick Lo
I'm working with 2 clients hosting on and am part leasing servers from Servint that I've setup to serve Django applications. Their green initiative is outlined here: http://www.servint.net/servintgreeninitiative.php Nick > I'm working on a project for an environmentally-co

Re: Could Django model dynamically create new class with new table?

2009-12-09 Thread Nick Arnett
ssification is a column on which you define the partitioning), which would be a Good Thing (because this really doesn't belong at the application level if at all possible). Nick -- You received this message because you are subscribed to the Google Groups "Django users" group. To post

Re: Can I change the models.py of an existing django app?

2009-12-11 Thread Nick Arnett
bat FROM old_foo. 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 from this group, send email to django-users+unsubscr...@googlegroups.com. F

Re: access legacy data without model.py

2009-12-13 Thread Nick Arnett
ractice would be to create a data access module for this purpose and import it when you need it. I've done this a few times for MySQL access and even wrapped some of the more frequent patterns and queries into methods in that module. Nick -- You received this message because you are subscr

Re: How to ordered comments by date ???

2010-04-16 Thread Nick Serra
You would order them on the model level or on the view level. In the model, you can set ordering with the Meta class 'ordering' parameter. In the view, you would just add .order_by() to your query. Check out these thinks: http://docs.djangoproject.com/en/dev/ref/models/options/#ordering http://do

Re: How to ordered comments by date ???

2010-04-16 Thread Nick Serra
Those *links! Hah. On Apr 16, 12:08 pm, Nick Serra wrote: > You would order them on the model level or on the view level. In the > model, you can set ordering with the Meta class 'ordering' parameter. > In the view, you would just add .order_by() to your query. Check out >

Re: how do you build an html website in python?

2010-04-17 Thread Nick Lacey
it going on, I can't begin to fix it. Anyway - I will persevere, and your link above looks very useful. 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-us...@go

overriding model save(), is an instance available?

2010-04-21 Thread Nick Serra
Hey everyone, thanks for looking. I'm overriding a model save(), and was wondering if there is an instance of the model being passed in that i can access. My situation is that i have a title and a slug. I only want to change the slug when the title is changed. So in my save i want to check: if s

Re: overriding model save(), is an instance available?

2010-04-21 Thread Nick Serra
Thank you, that seems like a clean way to do it. I'm getting a weird error when overriding init though. When I simply do this: class Entry(models.Model): title = models.CharField(max_length=255) slug = models.SlugField(max_length=255) body = models.TextField() user

Re: overriding model save(), is an instance available?

2010-04-21 Thread Nick Serra
Ahh, that'll do it. I'm used to the save() where you call super last. Works perfect, thanks for the solution! On Apr 21, 1:19 pm, Shawn Milochik wrote: > You should probably call that super __init__ first thing. Otherwise the > object won't really know how to behave like a Django model. > > Shaw

Re: Email Field

2010-04-21 Thread Nick Serra
I think i ran into this issue before. I don't think they define a max_length anywhere, the restriction is just on the database. Just increase the field size in the database and you should be good. On Apr 21, 2:20 pm, Tom Evans wrote: > On Wed, Apr 21, 2010 at 6:22 PM, CrabbyPete wrote: > > Yes,

Re: Working for a startup.

2010-04-22 Thread Nick Arnett
y to read, but I'd be curious what attracted them. There's a snake oil joke in there somewhere. 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.

Re: temp url with time limit

2010-04-23 Thread Nick Serra
Just create a model that stores the url and the expiration time. If the url is hit past the expiration time, delete it, if it's still within the time limit, display whatever you want to display. Obviously this is for a small system, since you would be waiting to delete until the url is hit, but its

Re: import request ? - django debugsqlshell

2010-04-23 Thread Nick Serra
Request is an object that django passes view functions that includes post data, meta data, and data about the request taking place. Not sure what your test function is doing, but to start, python is complaining because you are referencing the variable before it has been declared. You need to define

Re: New with Django

2010-04-23 Thread Nick Serra
Whenever I use django on my windows box, i use XAMPP, which is a all in one installer that gets apache and mysql. So I: - install XAMPP - install python - svn checkout django in the site-packages folder - install mysql bindings for python - install python image library and I think you need to add

Re: Performing an action on model.save() but not on update

2010-04-23 Thread Nick Serra
A post save signal seems better suited for this. The post save signal has an attribute 'created' that will be true or false depending on if the object is being created or updated. Check out the post_save documentation: http://docs.djangoproject.com/en/dev/ref/signals/#django.db.models.signals.post

Re: Performing an action on model.save() but not on update

2010-04-23 Thread Nick Serra
efined rather than > auto-incrementing pk. > > On Apr 23, 4:21 pm, Nick Serra wrote: > > > > > > > A post save signal seems better suited for this. The post save signal > > has an attribute 'created' that will be true or false depending on if >

Re: Performing an action on model.save() but not on update

2010-04-23 Thread Nick Serra
w, it increments TWICE! > > Is there some glaring error in my logic above? > > On Apr 23, 4:50 pm, Nick Serra wrote: > > > > > I didn't even think of that. It's not very common to be specifying > > pk's on create anyway, so yours would probably

Re: Performing an action on model.save() but not on update

2010-04-26 Thread Nick Serra
:) On Apr 26, 9:48 am, Jim N wrote: > Nick, > > Thanks very much.  That worked!  I can't work out why my code didn't > though (or rather, worked twice). > > -Jim > > On Apr 23, 6:37 pm, Nick Serra wrote: > > > > > > > Try this out and see

Re: Track "before" and "after" state of an object when editing in the Admin?

2010-04-26 Thread Nick Serra
There are a couple ways to do this. You can either override the model methods like save and init, or you can use signals and tie into the pre_save, post_save, etc. Signals are here: http://docs.djangoproject.com/en/dev/ref/signals/ If using signals, you will have an instance of the object being s

Re: Many-To-Many issue; trying to find a way around conditional id

2010-04-26 Thread Nick Serra
Can you be more clear on the exact result you're trying to achieve? Do you want to see, for a given high school, how many recruit objects are foreign keyed to it? On Apr 26, 7:38 am, Nuno Maltez wrote: > Are you saying that: > > collegelist = > college.current_objects.filter(collegechoices__scho

Re: feed decorator

2010-04-26 Thread Nick Serra
Seems very odd how you're trying to implement this. Unless your pseudocode has me confused. Can you give us the view functions too? Seems like you're trying to use a decorator function on two views. Why don't you just bail on the decorator, and just check for request.GET.get('format') == 'rss', and

Re: difficulty with 1.2 CSFR processing

2010-04-26 Thread Nick Serra
Include request context: from django.template import RequestContext ...and then pass it in with the render. That should include the token in the template. return render_to_response('add_pair.html', {}, context_instance=RequestContext(request)) On Apr 26, 12:45 pm, jeff wrote: > so i have some

Re: How to return an audio file in django

2010-04-26 Thread Nick Serra
Interesting. If the file is an mp3, maybe try: file = open("/path/to/my/song.mp3", "rb").read() response['Content-Disposition'] = 'attachment; filename=filename.mp3' return HttpResponse(file, mimetype="audio/mpeg") On Apr 26, 1:20 pm, Dexter wrote: > Hi there, > > I want to send an audio file v

Re: M2M Manager -- how to get primary key of join table?

2010-04-26 Thread Nick Serra
You could create a model that references the join table itself. class ArticlePublicationsJoin(models.Model): id = models.AutoField() publicaiton_id = models.IntegerField() article_id = models.IntegerField() class Meta: db_table = 'article_publications' then just query on

Re: adding foreign key attributes to the admin editing screen

2010-04-26 Thread Nick Serra
Are you trying to interface django with an existing table? Why do you have the StandardCode class foreign key-ing to the table, instead of just making a model that references the table exactly? On Apr 26, 2:43 pm, Jesse wrote: > Table LOINCCode has loinc_obr4 (a number) and a description field >

grabbing request while overriding save or in a signal

2010-04-28 Thread Nick Serra
Hey everyone. I'm trying to access the request object while overriding the save or tapping into the post_save on a model. I need request info when someone posts a comment. But I don't just want to handle this in my view, I would like it to be cleaner than that, so that functionality would remain ev

following reverse relationship of an extended model

2010-04-28 Thread Nick Serra
Hey, quick query question. I know there has to be an answer for this one, just don't know the syntax. I need to follow the reverse relationship for an extended model. class Account(models.Model): name = CharField class Entry(models.Model): account = ForeignKey(Account) class Page(Entry):

Re: following reverse relationship of an extended model

2010-04-28 Thread Nick Serra
Yeah, that is going to be my fallback, I was just curious on an actual reverse relationship solution to the situation. Thanks for the input! On Apr 28, 4:12 pm, zinckiwi wrote: > > class Account(models.Model): > >     name = CharField > > > class Entry(models.Model): > >     account = ForeignKey(

Re: grabbing request while overriding save or in a signal

2010-04-30 Thread Nick Serra
Yeah, I realize this now hah. Instead I am now passing request into a ModelForm for what I need. Basically I have a comment system, and on each comment post I wanted to run it through Akismet, which required the IP and User Agent. So I just passed request into my form.save() method on comment adds.

Encoding makes text go away in templating; mx.DateTools.strptime v. utf-8

2010-04-30 Thread Nick Arnett
ring... but I'm hoping somebody here has seen something similar - vanishing string after encoding...? Thanks in advance for any insights. Nick P.S. As often happens, describing the problem helped a bit... it seems to be related to mixing unicode and non-unicode strings. When I decode the

Re: Is it safe to alter Django generated tables in MySQL to have composite PK?

2010-04-30 Thread Nick Arnett
r data... or, even easier, create a whole new database with syncdb and copy your data into it. 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: Is it safe to alter Django generated tables in MySQL to have composite PK?

2010-05-02 Thread Nick Arnett
On Sat, May 1, 2010 at 11:13 AM, Continuation wrote: > > On Apr 30, 9:42 pm, Nick Arnett wrote: > > > If you don't have data in the table, just drop it and use > "unique_together" > > in models.py to define your composite key. You'll find that i

Re: override a form field, to allow usernames with '@'

2010-05-04 Thread Nick Serra
I just implemented this and it's a hassle. There are heated discussions about it. I ended up modifying the auth app and completely eliminating the 'username' field and just using email. Then I modified the admin app to allow the login, and am basically just completely overriding both. Good luck! O

Re: Django 1.2 release candidate available

2010-05-06 Thread Nick Serra
Awesome! Thanks so much! On May 6, 3:32 am, Federico Capoano wrote: > I've been using the beta for a while and it works pretty good for what > I've seen. > > On May 6, 6:40 am, James Bennett wrote: > > > > > > > Tonight we're proud to announce, finally, the first Django 1.2 release > > candidate

Additional Text Form Field within a Models Admin Screen

2010-05-08 Thread Nick Taylor
ld be greatly appreciated! Thanks a lot, 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 from this group, send email to django-users+unsubscr...@google

Custom Model Fields

2010-05-09 Thread Nick Taylor
the rest. Hopefully I'm pretty close, any ideas anyone? Thanks in advance, 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 from this group, send

Saving objects that have foreign key fields using the pk instead of an instance of the foreignkeyed object

2010-05-12 Thread Nick Serra
Sorry for the confusing title. Here is a simple example to illustrate my question: class Item(models.Model): name = models.CharField() class Manager(models.Model): item = models.ForeignKey(Item) On a POST I have the PK of the Item I want to link to a new instance of the Manager object.

Re: Saving objects that have foreign key fields using the pk instead of an instance of the foreignkeyed object

2010-05-12 Thread Nick Serra
Thanks for the response. I actually will already have the PK, and am trying to avoid grabbing an instance of the actual item object. On May 12, 11:26 am, Daniel Roseman wrote: > On May 12, 4:04 pm, Nick Serra wrote: > > > > > > > Sorry for the confusing title. Her

Re: Saving objects that have foreign key fields using the pk instead of an instance of the foreignkeyed object

2010-05-12 Thread Nick Serra
Exactly what I was looking for, thanks! On May 12, 11:50 am, Daniel Roseman wrote: > On May 12, 4:34 pm, Nick Serra wrote: > > > Thanks for the response. I actually will already have the PK, and am > > trying to avoid grabbing an instance of the actual item object. > >

Re: Django Sphinx or haystack Xapian

2010-06-19 Thread Nick Arnett
nth, which I'd rather not have to pay yet. 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 from this group, send email to django-users+unsub

Re: Django Sphinx or haystack Xapian

2010-06-19 Thread Nick Arnett
technology for a long time and I should know that search performance always demands lots of memory... So I may bite the bullet and use Solr, after all. I just wish there were a way to trade off the memory for speed until I'm ready to deploy a real working version. Nick -- You received t

Price fixing (was Re: How much would you charge for this? £5k? £15k? £50k?)

2010-06-21 Thread Nick Arnett
fairly good description of the issue, look at the HTML Writer's Guild guidelines: http://www.hwg.org/resources/faqs/priceFAQ.html 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: www.djangoproject.com

2010-07-08 Thread Nick Raptis
locale like en-US, some django pages won't ever display. Nick On 07/08/2010 04:11 PM, eon wrote: Same for me. The problem is in the firefox profile (maybe due to the switch from 3.5 to 3.6 ?) Start-up with a new profile (backport plugins, bookmarks argh...) resolves the issue On 5 juil

Re: www.djangoproject.com

2010-07-08 Thread Nick Raptis
locale like en-US, some django pages won't ever display. Nick On 07/08/2010 04:11 PM, eon wrote: Same for me. The problem is in the firefox profile (maybe due to the switch from 3.5 to 3.6 ?) Start-up with a new profile (backport plugins, bookmarks argh...) resolves the issue On 5 juil

Re: www.djangoproject.com

2010-07-08 Thread Nick Raptis
h mail accounts configured for the list and thought only one would go through as the first answer I sent lagged significantly. I hope this gets sent properly. Glad i could be of help, Nick On 07/08/2010 06:32 PM, Andi wrote: On Jul 8, 5:12 pm, Nick Raptis wrote: If there is a non-standar

<    1   2   3   4   5   6   7   >