Re: How to impose a permission-based filter in admin?

2009-01-07 Thread ZebZiggle
Wow ... that article is so good, it needs to be part of the standard Django docs. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: How to impose a permission-based filter in admin?

2009-01-07 Thread ZebZiggle
Karen officially rocks. 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

Re: How to impose a permission-based filter in admin?

2009-01-07 Thread ZebZiggle
Upon further research ... I'm suspecting I need to create a Manager and override get_query_set(), but since I don't have a request object, I can't get the currently logged in user. Is there a recommended approach to this for the dev stream? -Z

How to impose a permission-based filter in admin?

2009-01-07 Thread ZebZiggle
Hi, I have two Model classes: class Opportunity(models.Model): rep = models.ForeignKey(User) ... class Deal(models.Model): opportunity = models.ForeignKey(Opportunity) ... I want to limit the admin UI so that users can only see Opportunities and the related Deals they own. If they

How to: Inverted ForeignKey usage - Using admin a little backwards?

2009-01-06 Thread ZebZiggle
Hi all, Sorry for the cryptic subject line, but I don't know how else to describe it. I have two tables: class Opportunity(models.Model): ... class Deal(models.Model): opp = models.ForeignKey(Opportunity) ... However, in the admin, I want the user to enter the data for the Opportunity

Re: Ning-like applications for Django?

2008-05-28 Thread ZebZiggle
Cool, looks like a promising start. I'm working with Ning tech support to see what's happening (seems to be a slow .css loading). So, if they can't resolve, I'll load pinax. Out of curiosity, how many people are working on Pinax? Thanks for quick response! -Z

Ning-like applications for Django?

2008-05-28 Thread ZebZiggle
Hi, for a new project I'm working on I had planned on using Ning as the community holder and then using Django to make widgets to fit inside. But I find that Ning is painfully slow to the point that it's unusable (anyone else found this)? That said, I think I need to go another route. Can

Strangeness with Postgres and Order_by() ...

2008-01-02 Thread ZebZiggle
Hi all! I'm seeing a really strange behavior. I have a query q = Company.objects.filter(asOf__isnull = False).filter(Q(exchange = 1) | Q(exchange = 2)).order_by("name")[1:50] When I run it from the command prompt, it gives proper results. But when I run it as the web application / view, the

Re: Using edit_inline DateField is not showing up

2007-10-25 Thread ZebZiggle
Thanks Karen ... do you of a way to override this behavior? I can think of many situations where you would want to be able to modify it. -Z --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group.

Re: Using edit_inline DateField is not showing up

2007-10-25 Thread ZebZiggle
I'm having the same/similar problem. I have a field created = models.DateTimeField(auto_now_add = True) which doesn't show up in the admin interface, but everything else does ... including other datetime fields (just not auto_add_now). The field exists in the database, is used and getting

Looking for good forum software for integration with Django project ...

2007-08-09 Thread ZebZiggle
I need a good comment/forum library, ideally with Karma/Blocking/ Voting/etc to integrate with my django project. I've looked at PHPBB and vbulletin which are good, but I can't stand PHP. Any suggestions? Anyone interested in making a Django side project for this? -Z

Resolved: CachedDnsName - very slow under apache/mod_python ...

2007-06-26 Thread ZebZiggle
Upgraded mod_python to latest version and upgraded python 2.4.x ... problem gone away. Go figure. Thanks all! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send

Re: CachedDnsName - very slow under apache/mod_python ...

2007-06-26 Thread ZebZiggle
This gets even more weird. I copied the send_mass_mail() code from django.core.mail into my module so I could orchestrate it. I changed the DNS_NAME lookup to a hardcoded string and then got the 15s delay on the smtplib.SMTP(settings.EMAIL_HOST, settings.EMAIL_PORT) line?! So, perhaps the

Re: CachedDnsName - very slow under apache/mod_python ...

2007-06-25 Thread ZebZiggle
On Jun 25, 11:55 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > (for example, a setting for the fqdn so that we don't even do the lookup > if the setting exists). I like that idea. I should be able to just set DNS_NAME myself from the calling module. Let me investigate. Thx guys, Sandy

CachedDnsName - very slow under apache/mod_python ...

2007-06-25 Thread ZebZiggle
Howdy! Emails were taking 15s to send each. Upon investigation it came down to CachedDnsName in django.core.mail. Specifically, the socket.getfqdn() call. Also, it *always* happened, not just on startup. So it seems the call was timing out and the cache wasn't effective. The strange part is, it

Re: database filter with datetime ranges

2007-06-14 Thread ZebZiggle
Actually ... scratch that last point ... my bad. I think I'm onto the solution and the above query seems fine. But there's definitely a django bug in there somewhere. I'll submit it later. --~--~-~--~~~---~--~~ You received this message because you are

Re: database filter with datetime ranges

2007-06-14 Thread ZebZiggle
Yes, and it gets worse. I changed my query to be: ticks = list(StockTicker.objects.filter(exchange = 1) \ .extra(where = ["symbol = '@Gold' AND moment >= '%s' AND moment < '%s' " % (postgresDate(start), postgresDate(end))]) \ .order_by('moment')) (which works

Re: database filter with datetime ranges

2007-06-14 Thread ZebZiggle
Further investigation ... the sql looks good I think: ... FROM ... WHERE ( ... AND "igapp_stockticker"."moment" < 2007-06-14 05:00:00 AND "igapp_stockticker"."moment" >= 2007-06-13 05:00:00) Is there some special markup required for postgres to utilize the time info? Baffled. PS> Yes, the

Re: Unicode-branch: testers wanted

2007-06-13 Thread ZebZiggle
Hi, I'm really stuck on a bug (decode exceptions on attempting to save utf-8 to postgres text fields) and suspect I'm going to need the unicode branch to solve it. But I have some questions: 1. When is it likely that this branch will be merged with trunk? 2. How would you rank the stability of

Re: Scalability where file uploads are involved

2007-06-08 Thread ZebZiggle
If your focus is on images, I can't recommend this utility strong enough: http://www.aurigma.com/ I believe Facebook uses it and I have no relation to it. It's a client-side compression utility for images and it supports a Java / ActiveX client model ... whatever works. Of course, you need to

The going rate for Django-based web developers ...

2007-06-08 Thread ZebZiggle
Here's a nice softball question for a Friday afternoon ... What is the average going rate for seasoned Django developers? Hourly rates or annual salaries are fine. Strong python, javascript, CSS, postgres, jquery (or alike), debugging and lots of general experience in software development. And

RESOLVED: Re: Query Question ...

2007-05-23 Thread ZebZiggle
Took some custom SQL, but this works well: content = Content.objects \ .filter(approved__isnull = False) \ .extra(where=['id not in (SELECT content_id FROM relationship WHERE user_id = %d and "hasRead" = TRUE)' % user.id]) \ .order_by('-created')

Re: Explicit SQL not working ...

2007-05-23 Thread ZebZiggle
Joseph ... you da man! Next time your in Halifax, Nova Scotia ... the beer is on me. I was looking at that method and ignored it since I'm not using transactions. THANK YOU! -Sandy --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Re: Explicit SQL not working ...

2007-05-23 Thread ZebZiggle
More info ... I wrote a little program to execute the query directly via psycopg and it works fine. Even if I take this test code and put it in the running django code, it continues to work fine. The SQL is an UPDATE command, like UPDATE content SET

Re: Explicit SQL not working ...

2007-05-23 Thread ZebZiggle
More info ... I wrote a little program to execute the query directly via psycopg and it works fine. Even if I take this test code and put it in the running django code, it continues to work fine. The SQL is an UPDATE command, like UPDATE content SET

Re: Explicit SQL not working ...

2007-05-23 Thread ZebZiggle
More info ... I wrote a little program to execute the query directly via psycopg and it works fine. Even if I take this test code and put it in the running django code, it continues to work fine. The SQL is an UPDATE command, like UPDATE content SET

Re: Explicit SQL not working ...

2007-05-23 Thread ZebZiggle
More info ... I wrote a little program to execute the query directly via psycopg and it works fine. Even if I take this test code and put it in the running django code, it continues to work fine. The SQL is an UPDATE command, like UPDATE content SET

Re: Explicit SQL not working ...

2007-05-23 Thread ZebZiggle
More info ... I wrote a little program to execute the query directly via psycopg and it works fine. Even if I take this test code and put it in the running django code, it continues to work fine. The SQL is an UPDATE command, like UPDATE content SET

Explicit SQL not working ...

2007-05-23 Thread ZebZiggle
I'm doing a very simple direct SQL call cursor = connection.cursor() cursor.execute(sql) which works when I issue the SQL directly in the database, but via django does nothing. cursor.rowcount returns correctly, but there are no rows to fetch and the database isn't updated. Any

Query Question ...

2007-05-23 Thread ZebZiggle
Hi all (again), I'm hoping someone can help me with the syntax for this django query I have three related tables class User(models.Model): # stuff ... class Content(models.Model): # stuff ... class Relationship(models.Model): user = models.ForeignKey(User) content =

Re: Voting systems & postgres transactions

2007-05-21 Thread ZebZiggle
Hmm, I suppose another approach and possible horrible hack might be: 1. Create a queue of updates to the Content object 2. Votes are appended to the queue and immediately added to the UserContentRelationship table. 3. A separate thread processes the queue periodically to ensure atomic updates to

Voting systems & postgres transactions

2007-05-21 Thread ZebZiggle
Yes, this is yet another voting design discussion. As far as I can see there are two approaches: 1. A separate table that records the User-Content relationship including the vote -1/0/+1 and, optionally: 2. A voting field in with the content that gets atomically updated with each vote. Just

Re: Django IDE

2007-04-04 Thread ZebZiggle
I've been using it for a couple of years now. I'm still using 3.x, can't comment on 4.x. The debugging is pretty bad and doesn't really work as advertised, but the editor is solid (can run into resource leaks on low mem computers). The browser is good, the project mgmt is good. Overall, I'm happy

models.TABULAR Question ...

2007-04-03 Thread ZebZiggle
I want to be able to add new elements and delete individual elements ... can I do this with the Tabular view? For example: Container Element 1 [delete] Element 2 [delete] Element 3 [delete] add new Element new Container Is there a switch for this?

Re: Database exception handling please

2007-03-21 Thread ZebZiggle
Hey all! I run into a problem related to this discussion. Somehow, someway, I'm getting multiple entries in my data model where I should only ever have one. I suspect it's related to the users hitting the back button or double- clicking a submit button (or something). But it baffles me how

Re: Yet another ManyToMany with "Self" question ...

2007-02-21 Thread ZebZiggle
More on this ... it seems that django adds two entries to the join table. Doing: manager.subordinates.add(employee) added two entries: id = 7 from = 1to = 2 id = 8 from = 2to = 1 Is this the correct behavior? I would assume only one relationship should be added (from = 1 to = 2)

Re: Yet another ManyToMany with "Self" question ...

2007-02-21 Thread ZebZiggle
Anyone? --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For

Yet another ManyToMany question ...

2007-02-20 Thread ZebZiggle
I have a model: class Employee(models.Model): name = models.CharField(maxlength = 100) reportsTo = models.ForeignKey('self', null=True, related_name='dependent_element') subordinates = models.ManyToManyField('self') I want to add the employee as a subordinate when the manager is

Re: Multiple applications and conflicting admin privileges ...

2007-01-17 Thread ZebZiggle
Anyone? ZebZiggle wrote: Hey all, Belated Happy New Year! I'm embarking on a new Django project (a business application vs. the http://www.MyDarkSecret.com game of my previous effort). I'm hoping to use the admin capabilities of Django for this project. However, I have App A and App B both

Multiple applications and conflicting admin privileges ...

2007-01-15 Thread ZebZiggle
Hey all, Belated Happy New Year! I'm embarking on a new Django project (a business application vs. the http://www.MyDarkSecret.com game of my previous effort). I'm hoping to use the admin capabilities of Django for this project. However, I have App A and App B both installed in the same

Re: Model validation errors ...

2006-11-09 Thread ZebZiggle
Ah ... of course. Thanks James! Keep up the great work! -Sandy --~--~-~--~~~---~--~~ 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: Model validation errors ...

2006-11-09 Thread ZebZiggle
More on this: If I change Accusation to: class Accusation(models.Model): game = models.ForeignKey(Game) player = models.ForeignKey(Player, related_name='related_player') accusedPlayer = models.ForeignKey(Player, related_name='related_accusedPlayer') isCommitted =

Model validation errors ...

2006-11-09 Thread ZebZiggle
Hi there, I've decided to drop my old 0.91 database and rebuild, rather than try to upgrade it. So, in my dev environment I've dropped the database, but now when I try to 'syncdb' I get the following validation error. Error: Couldn't install apps, because there were errors in one or more

Re: Yup, two more 0.91 -> 0.95 questions ...

2006-11-01 Thread ZebZiggle
Got'cha! That worked ... I'm now converted over to 0.95! Thanks for all of your great help Russ! -Sandy --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Yup, two more 0.91 -> 0.95 questions ...

2006-11-01 Thread ZebZiggle
Wow ... I had no idea about that. I must have a ton of duplicate records in production now. (more homework). What's the correct way to set a related object to null? -S --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: Yup, two more 0.91 -> 0.95 questions ...

2006-11-01 Thread ZebZiggle
Thx Russ! >> player.user.id = None >> player.save() >Yes. (assuming that the desired behaviour is to create a new > player as a result of your save) I assume you mean that player will get a new ID, but not that I'll end up with a duplication player record?

Yup, two more 0.91 -> 0.95 questions ...

2006-10-31 Thread ZebZiggle
What is the format for __id in filters? Does this code look correct (assuming characterDefinition is a member of GameElement): game.gameelement_set.filter(characterDefinition__id = characterId) Note the two underscores. Also, I'm assuming gameElement_set gets changed to lower-case

Per Server / Per Application threads?

2006-10-31 Thread ZebZiggle
Hey all! I want to spawn a thread when Apache starts that will do some stuff in the background. The thread will need to access the Django data model. I'd really like the solution to work with the development environment too (non-apache). I was thinking about just using a singleton during a

Re: More 0.91 -> 0.95: ProgrammingError models_foo.blah

2006-10-30 Thread ZebZiggle
Sorry, got it. I had to remove the /models directory and rename mydarksecret.py to models.py. I thought I could just change the import, but apparently not. Once I moved the files, it all worked ... like magic ;-) Cheers, Sandy --~--~-~--~~~---~--~~ You received

More 0.91 -> 0.95: ProgrammingError models_foo.blah

2006-10-30 Thread ZebZiggle
Hey all! I've got most of the heavy lifting completed in moving from 0.91 -> 0.95. But now I get the following: ERROR: relation "models_game" does not exist SELECT

Re: magic-removal upgrade problem - No module named extensions

2006-10-24 Thread ZebZiggle
Yup, was: from django.core.extensions import XXX now: from django.shortcuts import XXX thx! -Sandy PS> I'm sure there'll be more ... hang in there! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users"

magic-removal upgrade problem - No module named extensions

2006-10-24 Thread ZebZiggle
Hey all! I'm finally getting around to migrating from .91 to .95. I've done all the grunt work from the docs and now I'm doing some quick tests ... and running into problems. I'm sure I missed a step somewhere. Any idea what would cause this ViewDoesNotExist exception (No module named

How to do named HTML anchors with Django?

2006-06-13 Thread ZebZiggle
Sorry if this a really silly question everyone, but how do I jump to named anchor with the URL mapping of Django? I have a template that uses targets and want to go to a specific target from another page /mypage#foo Is this possible? If so, how? Thx, Sandy

Re: Strategies for upgrading production databases?

2006-05-12 Thread ZebZiggle
Hey, that's a good idea. I was thinking about a nice addition to Django where you would keep your old model files around and offer a few utility classes to do the diff / alter output for you. But your idea is a nice immediate step. Cheers, Sandy

Re: Strategies for upgrading production databases?

2006-05-11 Thread ZebZiggle
Thx Graham ... that's what I'll do. -Sandy --~--~-~--~~~---~--~~ 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,

Strategies for upgrading production databases?

2006-05-11 Thread ZebZiggle
Hey! What do most users do for upgrading production databases? I have an upgrade I'd like to make to my game, but it will require model changes. I could: 1. export the whole database, drop the tables, load the new schema, import the database 2. update just the tables that changed either way,

Django-Powered Game in Beta - MyDarkSecret.com

2006-05-08 Thread ZebZiggle
Hey everyone! As you may or may not know (or are sick of hearing about) ... I've been dabbling on a web-game for a while now. It's called "My Dark Secret" and it's an online Murder Mystery Dinner Party game. You get to participate in a murder mystery as a murderer or a suspect. Your challenge is

Re: Ecommerce & Django

2006-04-15 Thread ZebZiggle
haha ... thought it was going to be quoted. I agree to keeping the payment processing as a non-django component. I'll look at the links referred. Thx for that! -Z --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: Ecommerce & Django

2006-04-15 Thread ZebZiggle
I agree completely. --~--~-~--~~~---~--~~ 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 [EMAIL

Re: Ecommerce & Django

2006-04-14 Thread ZebZiggle
I have no interest in the shopping cart, shipping, etc. ... just the checkout and credit card processing. I'll happily do the SkipJack driver. -Z --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users"

Re: Ecommerce & Django

2006-04-13 Thread ZebZiggle
How about "Reinhardt"? Django's last name. -Z --~--~-~--~~~---~--~~ 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

Re: Ecommerce & Django

2006-04-12 Thread ZebZiggle
I'm just going through the same thing myself. For my particular application, I'm not doing a shopping cart, just a lump sum non-recurring payment. I was going to do all the HTTPS stuff myself to the transaction handler for approval and I'll accept the "means of payment" screens myself in Django.

Re: ProgrammingError ... after adding new field to my model ...

2006-03-19 Thread ZebZiggle
SOLVED! The text I was using for the value was unicode. This resulted in the string not being quoted when the SQL was being fabricated. For now, I did a u"My Unicode String".encode('ascii') and it works fine. Cheers, Zeb --~--~-~--~~~---~--~~ You received

Re: ProgrammingError ... after adding new field to my model ...

2006-03-19 Thread ZebZiggle
Good point. Sadly, I'm not constructing the SQL, Django is. It could very well be that postgres is mangling the value string (thinking it's a column) ... that would possibly also explain why the exception message is truncated. I was looking at the django code last night and can't see anything

Re: ProgrammingError ... after adding new field to my model ...

2006-03-18 Thread ZebZiggle
I did a django-admin "sqlclear" followed by an "install"... as I've done every other time I modify my model. Is there something else I need to do? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users"

ProgrammingError ... after adding new field to my model ...

2006-03-18 Thread ZebZiggle
Hey guys, (0.91 branch) I recently added a new field to one of my model classes, now whenever I attempt to save() a new record I get a ProgrammingError. The call looks like this: element = ScriptElement(script = script, scene = 0, type = CHARACTER_ELEMENT, characterFirstName = firstName,

Re: Django scalability question

2006-03-01 Thread ZebZiggle
I agree Herb, you need transactions as the basis for making this work. But, as you have stated you need other infrastructure to make the optimistic locking work. Either of the two approaches you mentioned make sense (although there are some issues in using timestamps). Again, Hibernate is a good

Re: Django in a Load-Balanced environment (ORM issues) ...

2006-03-01 Thread ZebZiggle
That sounds like a great suggestion Tim. That's the way I would expect it to work as well. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Django scalability question

2006-02-28 Thread ZebZiggle
That's good to know, but as you have stated previously, transactions alone won't solve this problem. There still needs to be some concept of versioning on top of the transactions, which isn't trivial (arguably/perhaps even harder to do right than supporting transaction wrappers). Perhaps we need

Re: Django in a Load-Balanced environment (ORM issues) ...

2006-02-28 Thread ZebZiggle
Hey guys ... that's fantastic ... just the sort of response I was hoping to see from the start of this conversation. Like they say in AA "the first step is admitting you have a problem" ;-) I will definitely explore all those options and make my contributions to the project. All the best, Zeb

Re: Django scalability question

2006-02-28 Thread ZebZiggle
Hmm, I don't think you could get a cycle short enough to avoid the race conditions described above. I agree that keeping objects in memory will not help the problem (as per my original post), but constantly freshening the object won't work either. Perhaps single-user is a an unqualified

Re: Django in a Load-Balanced environment (ORM issues) ...

2006-02-28 Thread ZebZiggle
Thx for the feedback guys. I agree that this problem is pretty fundamental. I don't know what worries me more, the fact that the problem exists or the architects don't see the problem. I think in my case I can isolate the offending code and use some form of "double-buffering" technique to solve

Re: Django scalability question

2006-02-28 Thread ZebZiggle
Hugo/Georg is exactly correct. I'm sure there are many very large websites using Django, but from what I see many are newspaper-style (many reads, few if any writes except by the admins). I'd be curious how may sites are doing dynamic updates by many concurrent users? In a read-only / content /

Re: Django in a Load-Balanced environment (ORM issues) ...

2006-02-28 Thread ZebZiggle
Here is a blog article about what core functionality an ORM should support: http://pythonnotes.blogspot.com/2004/09/python-orm-tools.html Specifically, take note of the paragraph that reads: To implement true object persistence, each object needs a unique identifier. Each ORM will use a

Re: Django scalability question

2006-02-28 Thread ZebZiggle
Sorry, but I don't think Django will work in anything but a single user environment, or multi-users only doing read-only access. Unless someone from the Django team can clarify. Please read my thread on this issue ... it's a big concern for me.

Re: Django in a Load-Balanced environment (ORM issues) ...

2006-02-27 Thread ZebZiggle
Does anyone from the Django team have any thoughts on this problem? Am I missing something here? -Z --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Django in a Load-Balanced environment (ORM issues) ...

2006-02-18 Thread ZebZiggle
I'm sure I must be missing something obvious here folks, but perhaps someone could shed some light for me. Could someone please point me to some material on using Django in a load-balanced environment? The specific problem I'm facing is model ORM objects going "stale" (the in-memory

Re: Continued Css/Image problems ...

2006-02-01 Thread ZebZiggle
Arghh ... updated to 0.91 and now it works. Back to work everyone! -Z

Re: Continued Css/Image problems ...

2006-02-01 Thread ZebZiggle
More on this ... If I turn on show_indices ("... 'show_indexes': True"), then I can navigate all the way down to my target media, until I actually click one ... that's when I get the "redirection limit" error. There are about 15 requests for the mangled URI shown above (each doing a 302

Continued Css/Image problems ...

2006-02-01 Thread ZebZiggle
Hey all, I've been reading the other thread about static files and getting this to work with the development environment (v 0.90). Sadly, the instructions doesn't work for me, I keep getting 302 errors: The following Html: give me this error in the HTTP server: [02/Feb/2006 02:26:10]

Re: Comparing model objects ...

2006-01-16 Thread ZebZiggle
Actually, you know, I'm getting several situations where that comparision is failing, but if I explicitely do foo.id = blah.id it works. Looks like a bug. It seems to occur when I a foreign key lookup like: if foo.get_blah() == myBlah: # doesn't always work ... while if foo.get_blah().id ==

Re: Unit testing and a "Controller" layer ...

2006-01-15 Thread ZebZiggle
Yup, Selenium is a nice package ... if you have to go to trouble of browser-based unit testing I would strongly recommend it too. Thx for the feedback! -Z

Re: Unit testing and a "Controller" layer ...

2006-01-15 Thread ZebZiggle
Thx Eric, I'll look into this MixIn/No-table approach ... it seems interesting. It looks like it should give me back the object-oriented features I want of python and yet keep the business logic out of the view code. I was wondering about using Manipulators as the controller, but I don't know if

Re: Comparing model objects ...

2006-01-15 Thread ZebZiggle
That's great ... thanks for the clarification. -Z

Unit testing and a "Controller" layer ...

2006-01-15 Thread ZebZiggle
Hi again, I'm messing around with my Model and my views and putting a 'unittest' jig around what I'm building. Certainly, I don't want to test at the view layer (passing in HttpRequests and getting back HttpResponses), so I find that I'm writing a "controller-like" layer between the view and the

Comparing model objects ...

2006-01-15 Thread ZebZiggle
Hi there! Just getting into django and so far I'm really impressed (although I second the sentiment for creating a unit testing framework). My question is this: When I want to compare two model objects is it safe to do something like this: user = users.get_list(id__exact = 3)[0] if user ==