beginner model question - two tables without foreign keys (myslq - myisam)

2009-03-16 Thread Norman
How to perform such simple query: select p.text, b.title from books b, phrase p where p.book_id = b.id on tables books{ id : int, title: varchar } phrase{ id : int, book_id : int, text: varchar } but using django models? --~--~-~--~~~---~--~~ You received thi

middleware cache problem

2009-07-21 Thread Norman
Hi all, I cache my view that show a list of stories, but I have also small voting button (like digg). Voting is done be middleware class (it reads user IP), so I can ask for view with list of stories and tell that this list shall be cached and I have to ask middleware for vote results. Unfortuna

Re: middleware cache problem

2009-07-21 Thread Norman
per-view cache is not a solution because I need only a method to retrieve fresh (not cached) data from middleware. I wanna take cached list of stories and not cached vote results for it. regards, Norman On Jul 21, 3:13 pm, Michael wrote: > On Tue, Jul 21, 2009 at 9:02 AM, Norman wr

Comments & Forum app (all in one)

2009-03-27 Thread Norman
Hi, Is there any app that can be used as comment - under blog entries - and as forum - to see all blog comments ( /forum). regards, Normanek --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To p

where can I find email alert functionality

2009-10-06 Thread Norman
hello, I look for email alert functionality, where readers sign up to get notifications when news happens. But I can't find any suitable django app. So where can I find something like this? Any snippet or source code? regards, nomanek --~--~-~--~~~---~--~~ You

django ngnix multihost on single django instance

2010-04-01 Thread Norman
Hi, I'm trying to test simple portal with two apps and two sub domains mysite.com and blog.mysite.com, but I cant find any example of ngnix configuration file on local ubuntu server. So my question is - how to setup ngnix and django to test such multihost on single django instance and local pc?

Re: New to django and python. error following tutorial w/ the shell

2008-05-05 Thread Norman
Kenneth Gonsalves escribió: > > On 06-May-08, at 9:37 AM, Jason Ourscene wrote: > >> def __unicode__(self): > > def __unicode__(self): <- space after 'def'. If you use a > python editor it will find errors like this > and what editor do y

Re: How do I know, in a unit test, the user authenticated after login?

2008-07-16 Thread Norman Harman
testing an object creation? It's reasonable. I'd probably just use count instead of len(), it should be faster and more clearly indicates what you are testing. I'd also use assertEqual instead of assertTrue for clarity. before_count = Cartera.objects.filter(usuarioID=user.id).cou

Re: How to deal with two distinct UserProfile model ?

2008-07-16 Thread Norman Harman
del. http://www.djangoproject.com/documentation/contenttypes/ Ditch/copy Django's auth and roll your own/modify it to work they way you need. -- Norman J. Harman Jr. Senior Web Specialist, Austin American-Statesman ___

Re: ImageFiled Uploads

2008-07-16 Thread Norman Harman
Dane Hesseldahl wrote: > How do I get to the image when the avatar field has an image uploaded > through it? http://www.djangoproject.com/documentation/upload_handling/ -- Norman J. Harman Jr. Senior Web Specialist, Austin American-Sta

Re: accessing an attribute for the first item in a template context

2008-07-16 Thread Norman Harman
ch. Probably works with trunk as well. Is this new? I really thought numerical indexing did not work. Are you not using trunk? If not you should be, and if so there must be something else going on (username instead of user_name?) as t

Re: Why 2 servers to serve dynamic and static content?

2008-07-17 Thread Norman Harman
hole splitting dynamic/static content issue until and if I run into scalability issues. -- Norman J. Harman Jr. Senior Web Specialist, Austin American-Statesman ___ You've got fun! Check out Austin360.com for all the

Re: keeping a list of objects sorted

2008-07-17 Thread Norman Harman
lts in the wanted ordering. > When rendered in html, I loose this precise ordering. If you use the same code in your view as above then the ordering should not change. How are you displaying in template? Should be using something like {% for article in articles %} stuff {% endfor %)

Re: keeping a list of objects sorted

2008-07-17 Thread Norman Harman
jelle wrote: > Hi Norman, > > Yep, I'm just looping through the list. > Pretty awkward, right? Yes, very. Is the html output order seemingly random? or is there some pattern to it? Cn you post the code for the view? I'm guessing there is a typo or something s

Re: Heavy database query (max 32 tables problem)

2008-07-18 Thread Norman Harman
quot;id", flat=true) courses = Course.objects.filter(users__id__in=user_ids) I've used 'in' with a many hundreds ids. Have no idea how performant it is compared to other solutions. -- Norman J. Harman Jr. Senior Web Specialist, Austin American-Statesman

Re: Trouble with regex

2008-08-18 Thread Norman Harman
resumes ends with one. Another problem is your regex's don't include ^ match start of text. Without you t run into problems with regex doing partial match at end of string. Just like you are having your example. Since you omit the match start your 1st urls matches: /resumes/jss/no-

Re: django deploymennts

2008-08-19 Thread Norman Harman
before i decided it was not tool I'd want to use for deployment > My deployment procedure will be, I hope, an easy one: > > * download the version I want to deploy of the project (from > subversion) > * update database if needed > * restart application server if needed

Re: Redirecting to different page depending on user authentication

2008-08-20 Thread Norman Harman
stomized pages: The request instance that each view receives has a request.user attribute which is the current user (could be anonymous) see http://www.djangoproject.com/documentation/authentication/#users This can be used to customize the view for the user in whatever way you desire. -- Nor

Re: Renaming of mailing lists to avoid user confusion

2008-08-20 Thread Norman Harman
free books, blogs, cookbook/snippet site, IRC, and mailing lists. Help is abundant and in many forms. -- Norman J. Harman Jr. Senior Web Specialist, Austin American-Statesman ___ It's August! Keep your cool with the Stat

Re: Reverse URL Questions

2008-08-21 Thread Norman Harman
l-patterns url tag in templateshttp://www.djangoproject.com/documentation/templates/#url and reverse() in views/models/other to be excellent solution and the best way to handle this. Define your urls once in one place, your urls.py file. Change them and magically everything else just wor

Re: Init Parameter Trouble

2008-08-21 Thread Norman Harman
Robert wrote: > Hello all, Can we see your view code please? -- Norman J. Harman Jr. Senior Web Specialist, Austin American-Statesman ___ It's August! Keep your cool with the Statesman. Check out our hot deals

Re: Help needed: too complex for me

2008-08-21 Thread Norman Harman
abels labels = property(_prop_get_labels, _prop_set_lables, doc="""lables!""") Then your assignment article.labels = labels won't throw an exception, at least not for same reason ;) -- Norman J. H

Re: custom widget necessary?

2008-08-25 Thread Norman Harman
presentation (text fields, with "now" etc. shortcuts)? > > Like, e.g. > > Created: 08/25/2008 09:20am > > Do you have links to examples? http://www.djangosnippets.org/snippets/937/ -- Norman J. Harman Jr. Senior Web Specialist, Austin American-Statesman ___

Re: Calling attributes from other models

2008-08-25 Thread Norman Harman
One way to do this is to create helper functions. def _get_artist_hometown(self): return self.artist.hometown list_display = ('album','release_date',_get_artist_hometown) There're different options see http://www.djangoproject.com/doc

Re: Modules path when importing models

2008-08-25 Thread Norman Harman
all my apps plus settings.py file in that directory. some reading http://www.b-list.org/weblog/2007/nov/09/projects/ and http://www.pointy-stick.com/blog/2007/11/09/django-tip-developing-without-projects/ -- Norman J. Harman Jr. Senior Web Specialist, Austin American-Statesman __

Re: Building ORM relations without saving...

2008-08-29 Thread Norman Harman
ducts]) def test_sum_products(self): order = Order(number=1) product_list = [Product(price=20.0), ] self.assertEqual( 20.0, order.sum_products(product_list) ) -- Norman J. Harman Jr. Senior Web Specialist, Austin American-Statesman _

Re: Apache httpd conf with mod_python

2008-09-08 Thread Norman Harman
ything will work if you get rid of all of it. You need to add what Django requires. But, it sounds like you don't know/understand Apache conf files which you probably should. -- Norman J. Harman Jr. Senior Web Specialist, A

Re: How to prevent URL HTML encoding?

2008-09-12 Thread Norman Harman
instead of preserving the '+' symbols. > > Is there a way to prevent that? http://docs.djangoproject.com/en/dev/ref/templates/builtins/#safe http://docs.djangoproject.com/en/dev/topics/templates/#id2 -- Norman J. Harman Jr. Senior Web Specialist, Austin American-Statesman ___

Re: Accessing field names and data from a queryset in a generic template

2008-09-12 Thread Norman Harman
lect the correct template like so: t = loader.get_template('%s_list.html' % model.__name__) Create a wrapper aka "interface" or "proxy" that translates a standard set of fieldnames into the model specific fieldnames. So as far as the template is concerned th

Re: Problem with named paths

2008-09-17 Thread Norman Harman
ho-we- > are', u'how-we-are-different')' and keyword arguments '{}' not found. > > What am I doing wrong? Do you use {% url %} tag in that template 'dynamic_page.html'? and I think it's better not to use *args, **kwargs unless

Re: Reusable views from a template - How?

2008-09-17 Thread Norman Harman
= MyForm() add_links_to_context(context) render_to_response(... function handle_form(request, where_to_redirect_to): form handling logic here HttpRedirect(where_to_redirect_to) -- Norman J. Harman Jr. Senior Web Specialist, Austin American-Statesman _

Re: Can not under stand the error obtained when validating a model.py

2008-09-17 Thread Norman Harman
;, line 7, > in > from django.db.models.fields import DateField > File "C:\tools\Python25\lib\site-packages\django\db\models\fields > \__init__.py" > , line 666 > class DecimalField(max_digits = 32, decimal_places = > 0)IntegerField(Field): >

Re: Two Django visions running at once.

2008-09-17 Thread Norman Harman
advice. Esp based on the little bit of information you have provided. It is also probably not a Django question but a sysadmin question. -- Norman J. Harman Jr. Senior Web Specialist, Austin American-Statesman ___ Get off the

Re: resolving urls template error

2008-09-18 Thread Norman Harman
;, {} 'profile_myiq'), The error indicates you were providing either empty string, '', or the litteral characters '', (not sure the formating, probably is the former) Neither of which match the regex for arg "name". "\w+" matches 1 or more wor

Re: Querysets and includes

2008-09-22 Thread Norman Harman
be the best approach > to build these "widgets" for use on multiple pages? Any help would be > much appreciated. Thanks. Custom Template Tags? http://docs.djangoproject.com/en/dev/howto/custom-template-tags/#howto-custom-template-tags -- Norman J. Harman Jr. Senior Web Specialis

Re: Querysets and includes

2008-09-22 Thread Norman Harman
Charles Choiniere wrote: > On Mon, Sep 22, 2008 at 10:46 AM, Norman Harman <[EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]>> wrote: > > > nek4life wrote: > > How would I go about getting a queryset into an include? Say I > have a > >

Re: function import errors model import in other file

2008-09-22 Thread Norman Harman
ecimal import Decimal, ROUND_HALF_UP, ROUND_HALF_DOWN > > With this >> ImportError: cannot import name MetaData > > Full trace: http://paste.pocoo.org/show/85970/ > > > Thanx again! > > It looks like you have made a circular import: statemachine imports myfunct

Re: strategy for deploying to production server

2008-09-23 Thread Norman Harman
environment has a proj_settings.py that imports proj_base_settings.py and overrides whatever is required. This is often just setting DEBUG, email addy, and db. This file is not checked into source control. I prepend proj_ to all the settings files so I can have multiple projects in same python

Re: Querying Users with Permission

2008-09-25 Thread Norman Harman
e syntax would be this. permission = Permission.objects.get(name="in_artist_pulldown") users = permission.users.all() -- Norman J. Harman Jr. Senior Web Specialist, Austin American-Statesman ___ Get off the sid

Re: actual django stack

2008-09-25 Thread Norman Harman
to recommend to Djangonista's just starting out. And you forgot wsgi options ;) -- Norman J. Harman Jr. Senior Web Specialist, Austin American-Statesman ___ Get off the sidelines and huddle up with the Statesman all

http://alt.coxnewsweb.com/statesman/img/photos/3699112.jpg

2008-10-17 Thread Norman Harman
is there Sorry for the screw up -- Norman J. Harman Jr. Senior Web Specialist, Austin American-Statesman ___ Get off the sidelines and huddle up with the Statesman all season long for complete high school, college and pro

Unsubsubscribe

2010-06-06 Thread Jim Norman
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 How do I unsubscribe from this list? Jim Norman -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkwMVVMACgkQ677kSNWvnhS3EQCeO2OguYmNhKiyywl2HqXnLslF

Cache middleware causing unit tests to fail

2007-08-16 Thread Norman Harman
Hi, request.template is None instead of what it should be because the response is from the cache middleware. Which is fine. My question is there a good way to disable the cache middleware during tests? "good" being atleast the following. is automatic, isn't based of value of DEBUG, doesn

Re: Cache middleware causing unit tests to fail

2007-08-19 Thread Norman Harman
Eratothene wrote: > I think you better not disable cache middleware in tests. If tests > fail, so will be in production. I had similar problem, I thought it > was something wrong with tests, but really it was problem in the code. > My site was running well on django built-in server, but not on apa

Re: Link that performs an action

2008-04-10 Thread Norman Harman
lts) but those don't matter unless your site is real busy. another option parsing apache/nginx/whatever logs for whenever particular url(s) where responded to. -- Norman J. Harman Jr. 512 912-5939 Technology Solutions Group, Austin American-Statesman __

Re: Link that performs an action

2008-04-11 Thread Norman Harman
er(somefilter=whatever)) return HttpResponse(data, mimetype="text/javascript") or http://www.djangoproject.com/documentation/serialization/ -- Norman J. Harman Jr. 512 912-5939 Technology Solutions Group, Austin American-Statesman ___

Re: how do I create a zebra table using a template?

2008-04-11 Thread Norman Harman
roject.com/documentation/templates/#divisibleby > > Wouldn't http://www.djangoproject.com/documentation/templates/#cycle be a better solution? I think it was designed exactly for zebra tables. -- Norman J. Harm

Re: How to extend django.views.generic.date_based to return more "context variables"?

2008-04-14 Thread Norman Harman
Why don't you use the extra_context parameter to generic views? Or am I misunderstanding what you are trying to do? def myview(request): context = dict() context["my_custom_var"] = "wwgd" return generic_view(request, extra_context = context, bla=blah,...)

Re: How to extend django.views.generic.date_based to return more "context variables"?

2008-04-14 Thread Norman Harman
fizban wrote: > > On 14 Apr, 16:54, "Norman Harman" <[EMAIL PROTECTED]> wrote: > >> Why don't you use the extra_context parameter to generic views? Or am I >> misunderstanding what you are trying to do? >> >> def myview(request): >>

Re: Distributed databases

2008-04-16 Thread Norman Harman
I've never seen anything that would make this "easy" in Django itself. You will probably have more luck looking into sql proxies. Django will talk to the proxy, the proxy will figure out what database to actually query and return results to Django. This way Django doesn't have to change, do

Re: Enterprise applications with Django

2008-04-16 Thread Norman Harman
seems to me that the presentation > and logic are located on the same server for Django applications. > > Have you looked at PEAK Python Enterprise Application Kit http://peak.telecommunity.com/ -- Norman J. Harman Jr. 512 912-5939 Technology Solutions Gro

Re: Can I print out the context from within a template?

2008-04-18 Thread Norman Harman
iews and their variations. Not exactly what you are asking for but I find it better to fail unittests than throw exception at runtime. Alternatively or in addition you could set your production settings.py to something like, TEMPLATE_STRING_IF_INVALID = "this is a bug please email [EMAIL

Re: At what point does a model get its own app? Wigging as I try to adjust to the Django way.

2008-04-24 Thread Norman Harman
the process of parceling out a bunch of models myself. Don't > give yourself that headache!) If you are distributing apps separately you can use conttenttypes and generic relations. http://www.djangoproject.com/documentation/models/generic_relations/ django-tagging django-voting are s

Re: Few things ive been wondering

2008-05-06 Thread Norman Harman
h: > > in my models, a model object is only aware of the objects above it, > and not below it. > in C, i remember i just declared all functions, with no body to it, at > the top of the file > then all functions were aware of all functions. > how do i d

Re: accessing dictionary elements in opening tag of django template for loop

2008-05-14 Thread Norman Harman
ative is to pass in a context var that already has the list you want. -- Norman J. Harman Jr. 512 912-5939 Technology Solutions Group, Austin American-Statesman ___ Get out and about this spring with the Statesman! In print

Re: where does this caching come?

2008-05-15 Thread Norman Harman
t* want to set this on for production code(large performance penalty). PythonAutoReload On I'm guessing mod_wsgi and others have something similar. -- Norman J. Harman Jr. 512 912-5939 Technology Solutions Group, Austin American-Statesman

Re: encrypting form data

2008-05-15 Thread Norman Harman
Any suggestions? The standard http://www.djangoproject.com/documentation/csrf/ CSRF protection middleware does something like that. Don't know details but could look there. If you're gonna 1way hash things such as 'id' and worry about speed then store the 1way hashed value in dat

Re: encrypting form data

2008-05-15 Thread Norman Harman
how many records you have. http://www.guardian.co.uk/world/2006/jul/20/secondworldwar.tvandradio -- Norman J. Harman Jr. 512 912-5939 Technology Solutions Group, Austin American-Statesman ___ Get out and about this spring with the Statesman! I

Re: encrypting form data

2008-05-15 Thread Norman Harman
one: self.hash = self._generate_hash() And queries are: chapter = Chapter.objects.get(hash="wolewadu") Definitely make it indexed column though. The business case is different from what I think Mike wants b

Re: encrypting form data

2008-05-15 Thread Norman Harman
one: self.hash = self._generate_hash() And queries are: chapter = Chapter.objects.get(hash="wolewadu") Definitely make it indexed column though. The business case is different from what I think Mike wants b

Re: where does this caching come?

2008-05-15 Thread Norman Harman
Graham Dumpleton wrote: > On May 16, 12:21 am, "Norman Harman" <[EMAIL PROTECTED]> wrote: >> Alex Morega wrote: >>> On May 15, 2008, at 02:24 , David Zhou wrote: >>>> Are you restarting the server between module changes? >>> By default

Re: business logic and good practices

2008-05-20 Thread Norman Harman
not the reason, and if you really wanted to you could mix your app code and templates, by setting TEMPLATE_DIRS. None of your django code, templates, settings etc needs to be accessible via browser nor should it be. -- Norman J. Harman Jr. 512 912-5939 Technology Solutions Group, Au

Re: Incrementing by 4 instead of 1?

2008-05-20 Thread Norman Harman
n_count += 1 self.save() Then from your view call it def adopt_bunny(request, id): bunny = get_object_or_404(Bunny, pk=id) bunny.adopt() return single_bunny(request, id, True) -- Norman J. Harman Jr. 512 912-5939 Technology Solutions Group, Austin American-Statesman

Re: Try Except Statement not working properly.

2008-05-20 Thread Norman Harman
s something else going on. I would add print statements to determine what is in fact happening. for row in reader: try: b = OrderEmail(name=row[0], email=row[1], been_sent="0") b.save() print "saved", row except Exception, msg:

Re: Try Except Statement not working properly.

2008-05-21 Thread Norman Harman
Greg wrote: > Norman, > I added those print statements and ran the script. The output was > this over and over again: > > /// > > current transaction is aborted, commands ignored until end of > transaction block > > // > > Any suggestions? It sounds

Re: item "of the day"?

2008-05-22 Thread Norman Harman
fetch from database and store in cache with expiration of 24 hours. -- Norman J. Harman Jr. 512 912-5939 Technology Solutions Group, Austin American-Statesman ___ Get out and about this spring with the Statesman! In p

Re: item "of the day"?

2008-05-22 Thread Norman Harman
[EMAIL PROTECTED] wrote: > > > On May 22, 12:11 pm, "Norman Harman" <[EMAIL PROTECTED]> wrote: >> I don't know if this is the "right" direction but I've had success using >> memcached to implement of the day items. >> >>

Re: item "of the day"?

2008-05-22 Thread Norman Harman
blog: %s" % entry.title) return {"featured_blog_html": html} except Entry.DoesNotExist: pass def index(request): context = RequestContext(request) get_featured_blog_context(context) get_featured_foo(context) get_featured_bar(context) ret

Re: item "of the day"?

2008-05-23 Thread Norman Harman
'mykey') Sounds like you have caching disabled or are using something like dummycache. Are you sure memcached is running? Reread http://www.djangoproject.com/documentation/cache/#setting-up-the-cache -- Norman J. Harman Jr. 512 912-5939 Techn

Re: How to Implement "Most Viewed"?

2008-05-25 Thread Norman Harman
and updated a times_viewed field in the models. Scaling that to more than one machine adds complexity. I'd probably pursue a different solution when/if traffic warranted it. -- Norman J. Harman Jr. 512 912-5939 Technology Solutions Group, Austin American-Statesman __

Re: best solution for different address formats?

2008-06-11 Thread Norman Harman
is and how it should be formated. Users are more likely to know about changes to their countries addressing scheme. Etc, etc. With that in mind the best way to handle varying international addresses is with a largish char column backend and multiline text input box on frontend. -- Norman J

Re: Template engine

2008-06-13 Thread Norman Harman
000 The spaceless tag helps sometimes, but not for your situation. -- Norman J. Harman Jr. Senior Web Specialist, Austin American-Statesman ___ You've got fun! Check out Austin360.com for all the entertain

Re: Session lost between two requests from the test client

2008-06-13 Thread Norman Harman
.session['m_key'] but I get an error that session does not have > 'm_key' key. I've spent a lot of time debugging session problems only to discover I had made the bone headed mistake of having this settings combo CACHE_BACKEND="dummy://" SESSION_ENGINE=&quo

Re: Template engine

2008-06-13 Thread Norman Harman
h Django is http://superjared.com/entry/real-problem-django/. I didn't mean to sound complainy in previous post, if anyone took it that way. -- Norman J. Harman Jr. Senior Web Specialist, Austin American-Statesman __

Re: unit testing and comparing dictionaries

2008-06-17 Thread Norman Harman
elf._calc_value() super(FooModel, self).save() def test_value_on_save(self): test_data =( (dict(foo="", bar=""), 42 ), (dict(foo="1", bar="3"), 37 ), # test more edge cases, etc.

Re: redirect with post parameters

2008-06-17 Thread Norman Harman
to use something like urllib2 and POST to 3rdpary in your view code, slurp the response and send it back to user. It will have 3rdparty content but come from your server, which is probably gonna cause problems. -- Norman J. Harman

Re: serve static files

2008-06-17 Thread Norman Harman
omething else is wrong ;) btw hard coding a path "C:\dev\incidents\admin_media" in your urlpatterns is probably a bad thing to do. As whoever uses your app/where ever you deploy it for production is unlikely to install the app in the same place you do on your dev machine. -- Norma

Re: unit testing and comparing dictionaries

2008-06-17 Thread Norman Harman
> What about uniqueness, and composite field uniqueness? > # unique_together = (("field1", "field2","field3"),) > > I'm thinking it would make sense to try to > create 2 of an object and save them, and check that it fails Yep two of the objects whose 3 fi

Re: Dictionaries, templates and best practices

2008-06-17 Thread Norman Harman
ues() If order is important: list_o_dicts = [ dict_that_should_be_list[k] for k in sorted(dict_that_should_be_list.keys()) ] Then you can use the template for loop construct normally {% for dict in list_o_dicts %} {{ dict.post }} {{ dict.title }} {% endfor %} -- Norman J. Harman Jr.

Re: Adding suggest / accept functionality to models

2008-06-17 Thread Norman Harman
_suggestion = False def reject(self): assert self.is_suggestion # not sure how to delete relation # self.suggestion.suggestion = None ??? self.delete() -- Norman J. Harman Jr. Senior Web Specialist, Austin American-Statesman

correct list for newforms admin questions? named urls / replacing admin root page

2008-06-17 Thread Norman Harman
et the dynamic urls to work. url(r"^$", site.root, name="ts_admin", kwargs={"url":"specials/adspecial"}), Actually, I'd really love to learn a cleaner way to d

Re: correct list for newforms admin questions? named urls / replacing admin root page

2008-06-18 Thread Norman Harman
Brian Rosner wrote: > Hi Norman, > > On Jun 17, 2008, at 3:49 PM, Norman Harman wrote: > >> I want to use {% url %} to point into portions of the admin site(and >> change the default url structure). I hacked this generally >> unfullfilling but working version w

Re: Quick way to find list objects close to the current date?

2008-06-19 Thread Norman Harman
a more Django way of doing it > than me doing it manually. http://www.djangoproject.com/documentation/db-api/#range -- Norman J. Harman Jr. Senior Web Specialist, Austin American-Statesman ___ You've got fun! Check

new forms admin is there an equiv to unique_for_date

2008-06-19 Thread Norman Harman
This is what I'm talking about http://www.djangoproject.com/documentation/model-api/#unique-for-date Searching internets can not find any answer. Thanks, -- Norman J. Harman Jr. Senior Web Specialist, Austin American-Stat

Re: Thanks!!!!!!!!!!!!!!!!!

2008-06-20 Thread Norman Harman
primarily developing in Python, which was pretty hard to find not so long ago. Lately I've been answering what questions I can on this forum. Which is my preferred way of saying "thanks". I wish it was easier to contribute. -- Norman J. Harman Jr. Senior Web Specialist,

Re: Automatic Update of template

2008-06-20 Thread Norman Harman
return render_to_response("mytemplate", extra) see http://www.djangoproject.com/documentation/shortcuts/#render-to-response -- Norman J. Harman Jr. Senior Web Specialist, Austin American-Statesman ___ You

Re: custom form with admin look and feel

2008-06-23 Thread Norman Harman
e know what my template should contain to achieve admin look > and feel. look in django/contrib/admin/templates extending admin/base_site.html is what I believe you want. -- Norman J. Harman Jr. Senior Web Specialist,

Re: Where to install additional libraries?

2008-06-23 Thread Norman Harman
path every time /usr/local/python2.5/bin/python setup.py install or you can use an alias (I suggest adding to your .bashrc or similar file) alias python=/usr/local/python2.5/bin/python -- Norman J. Harman Jr. Senior Web Specialist, Austin American-Statesman __

Re: How best to delete one of multiple records?

2008-06-23 Thread Norman Harman
to work. Other options would be putting them in a ChoiceField and using Select (dropdown) RadioSelect (radio buttons) or some custom widget. The choice field options will have only one delete button but require user to select which record to delete. That may or may not be a better ui than

Re: Struggling with Django/legacy data

2008-06-23 Thread Norman Harman
model-api/#relationships to_field The field on the related object that the relation is to. By default, Django uses the primary key of the related object. -- Norman J. Harman Jr. Senior Web Specialist, Austin American-Statesman ___

Re: Deciding where I am in the template hierarchy

2008-06-24 Thread Norman Harman
t; root url. If so, I would determine this in the view and pass in a template varible, 'is_root'. But I don't think wrapping an extends in a if/endif will work. Or do you mean the template is root as in it doesn't extend any other templates. In that case just skip the if/

Re: global variable issue

2008-06-24 Thread Norman Harman
e state in a stateless server, use persistent storage like a DB. There *are* two or more copies of the global. There are as many copies as WebFaction runs instances of django (mod_python or whatever) It works in dev cause manage.py runserver only starts one instance of django. -- Norman J. Har

Re: Django inserts an empty string into IntegerField?

2008-06-25 Thread Norman Harman
create my own field, NullCharField or NullIntegerField that replaces "" or None with NULL according to the null=true parameter. -- Norman J. Harman Jr. Senior Web Specialist, Austin American-Statesman ___ You'v

Re: Django inserts an empty string into IntegerField?

2008-06-25 Thread Norman Harman
at programmer". btw, I really think IntegerField is the wrong column type for a zip code. They can be upto 11 chars long and have hyphens. I'd make it CharField or maybe even a USZipCodeField from 'contrib/localflavor/u

Re: Unit test problem

2008-06-26 Thread Norman Harman
tatus_code=302, target_status_code=200) http://www.djangoproject.com/documentation/testing/#assertions -- Norman J. Harman Jr. Senior Web Specialist, Austin American-Statesman ___ You've got fun! Check out Austin360.com for all the

Re: views.py: Always a simple return?

2008-06-26 Thread Norman Harman
There are reasons the HTTP Internet has exploded in a way client server never did. From my understanding of Comet it's more or less exactly what you are asking for. http://www.google.com/search?q=django%20comet -- Norman J. Harman Jr. Senior Web Specialist,

Re: Stability of trunk and 1.0 target: experience, testimonials?

2008-06-27 Thread Norman Harman
Django developers and community to maintain multiple stable branches. Compare Django release discipline and record to other major frameworks. And your PHB's should be scared to use anything but Django. -- Norman J. Harman Jr. Senior W

Re: Inheriting from auth.models.User

2008-06-30 Thread Norman Harman
blogs by the same author then there are 10 hits on user_profile to read it each time. -- Norman J. Harman Jr. Senior Web Specialist, Austin American-Statesman ___ You've got fun! Ch

Re: django+mod_python, caching or something else?

2008-07-02 Thread Norman Harman
Alex Koshelev wrote: > Or may be a custom template tag for common stuff. Or like any code anywhere just extract the common parts to a helper function and call that. -- Norman J. Harman Jr. Senior Web Specialist, Austin American-States

Re: testing login problem

2008-07-02 Thread Norman Harman
w > functions. Test system creates a new test database from scratch every time it is run. manage.py loaddata has NO effect on test. I could be wrong but I don't believe test runner automatically loads the fixture initial_data.xml You need to tell it what fixtures to load

  1   2   >