RE: requirements.txt

2021-03-02 Thread Buzz Norman
Hey I just figured it out. I ran requirements.txt before running “pip freeze > requirements.txt”  Sent from Mail for Windows 10 From: Mike DewhirstSent: Thursday, 25 February 2021 23:21To: django-users@googlegroups.comSubject: Re: requirements.txt On 25/02/2021 8:38 pm, Spence Buzz wrote:> Hello> I

Re: Cron Job

2015-10-14 Thread 'Chris Norman' via Django users
-commands/ On Wed, Oct 14, 2015 at 10:53 AM, 'Chris Norman' via Django users mailto:django-users@googlegroups.com>> wrote: Hi again, I would like to set up a cron job to email the day's journeys to a pre-defined set of email addresses, using the model I describe

Cron Job

2015-10-14 Thread 'Chris Norman' via Django users
Hi again, I would like to set up a cron job to email the day's journeys to a pre-defined set of email addresses, using the model I described in the previous example. I have it so I can type: python manage.py shell import journey_sender This does everything. Thing is, I would like to use the

Filtering records based on date months

2015-10-14 Thread 'Chris Norman' via Django users
Hi all, I have written a Journey model, which has an out and a back field, both of which are datetime fields. What I want to do is something like: from datetime import datetime now = datetime.now() for journey in Journey.objects.filter(out__month = now.month, out__day = now.day): print jour

Re: Does Django detect changes in models Meta ?

2014-09-03 Thread Norman Bird
Ok, I have version 1.6.5. I will see about updating. HmmmI had googled and this is the first im hearing of this. Got to love Django. :-) On Tuesday, September 2, 2014 5:40:52 PM UTC-4, Collin Anderson wrote: > > The newest version of django, version 1.7, has migrations built in. > -- You receiv

Re: Does Django detect changes in models Meta ?

2014-09-02 Thread Norman Bird
. :-) thanks On Fri, Aug 22, 2014 at 11:42 PM, Norman Bird wrote: > how about: python manage.py sql myapp > I just changed my model and I had to runt that in order to build the > tables. > > > On Fri, Aug 22, 2014 at 11:49 AM, Norman Bird > wrote: > >> I stand correcte

Re: Does Django detect changes in models Meta ?

2014-08-22 Thread Norman Bird
how about: python manage.py sql myapp I just changed my model and I had to runt that in order to build the tables. On Fri, Aug 22, 2014 at 11:49 AM, Norman Bird wrote: > I stand corrected. :-) > > > On Fri, Aug 22, 2014 at 11:47 AM, Larry Martell > wrote: > >> On Fri,

Re: Does Django detect changes in models Meta ?

2014-08-22 Thread Norman Bird
I stand corrected. :-) On Fri, Aug 22, 2014 at 11:47 AM, Larry Martell wrote: > On Fri, Aug 22, 2014 at 9:55 AM, Norman Bird > wrote: > > I am new, just completed the tutorials, but from my understanding you run > > "python manage.py syncdb" and that rebuilds th

Re: Does Django detect changes in models Meta ?

2014-08-22 Thread Norman Bird
I believe so. Wont hurt to try it and see what happens. On Fri, Aug 22, 2014 at 11:03 AM, Néstor wrote: > is that true if the table is already there? > > > On Fri, Aug 22, 2014 at 6:55 AM, Norman Bird > wrote: > >> I am new, just completed the tutorials, but from

Re: Does Django detect changes in models Meta ?

2014-08-22 Thread Norman Bird
I am new, just completed the tutorials, but from my understanding you run "python manage.py syncdb" and that rebuilds the tables etc. On Friday, August 22, 2014 3:32:43 AM UTC-4, termopro wrote: > > Hi there, > > I am using Django 1.7 RC2. > I have created models and have run all the migrations

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

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?

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

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

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

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

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

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

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

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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: urllib https post and parsing question

2008-07-11 Thread Norman Harman
se the Google or you can just use re module and parse the text yourself. -- Norman J. Harman Jr. Senior Web Specialist, Austin American-Statesman ___ You've got fun! Check out Austin

Re: Alpha Chars in dynamic url?

2008-07-10 Thread Norman Harman
u meant by "alpha chars" but \w+ matches more than just [A-Za-z]+ see http://docs.python.org/lib/re-syntax.html -- Norman J. Harman Jr. Senior Web Specialist, Austin American-Statesman ___ You've got fun! Check

Re: Accessing SQL result by column name

2008-07-10 Thread Norman Harman
s of postres) > to use column names in SQL queries instead of positional parameters? Your example uses the Python DB API http://www.python.org/dev/peps/pep-0249/ This explains how to do it with Django http://www.djangoproject.com/documentation/db-api/#values-fields -- Norman J. Harman

Re: Named URL not picking up parameter value

2008-07-09 Thread Norman Harman
Brandon Taylor wrote: > url(r'^(?P[w-]+)/$', 'my_site.groups.views.show_group', That regex matches one or more w's and hyphens. You surely wanted [-\w] to match letters, numbers, underscores and hyphens. -- Norman J. Harman Jr. Senior Web Specialis

Re: how to post XML with python / Django

2008-07-09 Thread Norman Harman
and python. Create a template.xml pass it and a context with your variables into render_to_string http://www.djangoproject.com/documentation/templates_python/#the-render-to-string-shortcut Then use Python stdlib http://docs.python.org/lib/module-urllib2.html to POST request. -- Norman J. Harman Jr.

Re: Problem with broken link emails

2008-07-09 Thread Norman Harman
I would strip out or disable all your javascript and if the /start_empty.gif requests stop you know the problem is in there somewhere. Is Apache doing any redirects? Look in it's conf files. Also worth a look at Apache's logs to find out more about exactly when and from were the /star_em

Re: memcached

2008-07-09 Thread Norman Harman
tle test scripts not using Django? You have provided too little information for anyone to tell you what is wrong. But with the above information and a little investigation you should be able to figure it out on your own :) -- Norman J. Harman Jr. Senior Web Specialist, Austin American-Statesman

Re: does django cache models.py?

2008-07-09 Thread Norman Harman
ut data in tables (i.e. it is ok if it is all deleted) and you change models in the foo app you need to run the following. manage.py reset foo manage.py syncdb If you do care about data then back it up first. Then you must create and run alter statements by hand or use a Django schema migration

Re: Trying to understand project structure w/apps

2008-07-08 Thread Norman Harman
delOne.objects.all() context["twos"] = ModelTwo.objects.filter(somekey=somevalue) render_to_response("main/index.html", context) > If someone could give me a few pointers in a direction they'd approach > this problem, it would be great

Re: Markup languages vs HTML

2008-07-08 Thread Norman Harman
use it anyway. Could use the cache system for something similar, your needs probably vary. markup is good for sophisticated / power users / niches where markup is expected (e.g. wikis) TinyMCE / js editor is good for the masses. -- Norman J. Har

Re: How to create field not stored in database, but visible in admin?

2008-07-08 Thread Norman Harman
t I'd use to implement "Setting and getting value of this field actually runs some defined operation" -- Norman J. Harman Jr. Senior Web Specialist, Austin American-Statesman ___ You've got f

Re: What's the best way to simulate a request?

2008-07-08 Thread Norman Harman
hen outline how you are reimplementing HTTP because you don't want to be "exposing the internal URLs" yet. I suggest spending an hour, a day learning about how your webserver(s) handle auth and start using it. My $.02US (only about .01 at today's rates) Baring that, o

Re: Usability: stripping white space from form fields

2008-07-07 Thread Norman Harman
__all__.extend(django.newforms.widgets.__all__) class StrippedCharField(CharField): """Newforms CharField that strips trailing and leading spaces.""" def clean(self, value): if value i

Re: removing page from cache (memcache)

2008-07-03 Thread Norman Harman
is? I realize that there is a good chance > that I am missing something obvious. http://www.djangoproject.com/documentation/cache/#using-vary-headers http://www.djangoproject.com/documentation/cache/#the-low-level-cache-api -- Norman J. Harman Jr. Senior Web Specialist, Austin American-States

Re: raise Http404("my message")

2008-07-03 Thread Norman Harman
'settings': get_safe_settings(), }) So, it looks like "reason" is the template var you want. -- Norman J. Harman Jr. Senior Web Specialist, Austin American-Statesman

Re: assertRedirects do not exist in 0.97 pre?

2008-07-03 Thread Norman Harman
Florencio Cano wrote: > Where is the problem? where you don't use django's TestCase > import unittest > class UserTestCase(unittest.TestCase): from django.test import TestCase class UserTestCase(TestCase): -- Norman J. Harman Jr. Senior Web Specialist, Austin

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

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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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,

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: 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

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

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: 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

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: 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: 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: 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: 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: 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: 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
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: 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: 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: 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: 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

  1   2   >