Re: can I mimic authenticated user from shell?

2007-03-06 Thread yary
Now's a good time to try the new testing framework's test client http://www.djangoproject.com/documentation/testing/#test-client login as whomever, send some URLs, check the results. I know it ain't quite what you're looking for, but it may help.

Re: {% url %} syntax, and its equiv in python?

2007-03-06 Thread yary
On Mar 5, 6:45 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > Hmm ... for consistency's sake, we should change that. We do seem to be > pretty much always resolving unquoted tokens as variables in the current > context. The only real exception I can find is the "ssi" tag (you have > to gloss

{% url %} syntax, and its equiv in python?

2007-03-05 Thread yary
I'm building up menus in django, and wanted a construct like this: {% for item in menu %} {{item.label}} but that doesn't work, because there's no view "item.view" so point 1, looks like a shortcoming in the syntax of the URL tag. With most tags, an unquoted item gets looked up, and a quoted

URL extra options placeholder syntax- or is it only for generic views?

2007-02-27 Thread yary
http://www.djangoproject.com/documentation/generic_views/ has this example: ... redirects from /foo// to /bar//: urlpatterns = patterns('django.views.generic.simple', ('^foo/(?P\d+)/$', 'redirect_to', {'url': '/bar/%(id)s/'}), ) What replaces the '%(id)s' section, the generic view package,

Re: Using django for CMS stuff

2007-02-16 Thread yary
On Feb 14, 12:12 pm, "walterbyrd" <[EMAIL PROTECTED]> wrote: > CMSes like joomla and drupal have a rich assortment of plugins/modules/ > extensions for stuff like: blogs, forums, galleries, news aggregators, > ecommerce, document management, and so on. > > How difficult would it be to get that

Selecting MySQL engine (InnoDB/MyISAM) when creating models

2007-02-13 Thread yary
There's a thread from June 28 '06 on this list about changing MySQL's storage engine from InnoDB to MyISAM for a particular table/model. Now, an InnoDB table respects foreign keys, and a MyISAM table ignores them. An "ALTER TABLE ... ENGINE = MyISAM" statement will fail if the table has any

Re: ForeignKey, null, and schema evolution

2007-02-10 Thread yary
IIRC, Django's admin can't handle a field with null=True and blank=False (which is a bit of a shame...) Try adding blank=True to your model's field? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users"

Re: ForeignKey model vs. Foreign Key database

2007-02-07 Thread yary
Feb 7, 3:03 pm, "yary" <[EMAIL PROTECTED]> wrote: > ... If I could get some guidance as to writing the test > (as mentioned in the 2nd half of my original message) I'd me much > obliged, and will get to work on patching #2720. I think I can figure it out, will ping back

Re: ForeignKey model vs. Foreign Key database

2007-02-07 Thread yary
Thanks for the ref. That patch doesn't address the problem of a ManyToMany field referring to not-yet-created tables, and the patch breaks my project. If I could get some guidance as to writing the test (as mentioned in the 2nd half of my original message) I'd me much obliged, and will get to

Re: Newbie: is it possible to use Django's db API outside of Django?

2007-02-07 Thread yary
On Feb 7, 1:22 pm, [EMAIL PROTECTED] wrote: > Thanks for the link! > Would I really have to set up my backend app as a Django App? > Is it required to due to some meta-programming magic? > ie I'd rather not have to run our app via manage.py/django-admin. let me see if I understand your

ForeignKey model vs. Foreign Key database

2007-02-07 Thread yary
I was looking at the Django-created database structure for my project in a tool that shows all the foriegn-key relationships with nice little lines (aka ER diagram). It looked very sparse. Most of my relationships weren't showing up. A little digging shows me that MySQL (windows, 5.0, InnoDB

finding verbosity in tests.py?

2007-01-31 Thread yary
Quick question- how do I find the verbosity in which my tests are running? something like "from import verbosity"? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Re: Post-post_syncdb signal?

2007-01-23 Thread yary
On Jan 23, 6:10 pm, "Russell Keith-Magee" <[EMAIL PROTECTED]> wrote (in different order): > One of the goals of the fixtures framework is to rename 'initial data' > to 'custom SQL' - the goal here being to move the loading of initial > data out of SQL statements into a database independent

Post-post_syncdb signal?

2007-01-23 Thread yary
I'm setting up some group permissions in management.py but am running into (I think) order-of-signalling issues. When I get my post_syncdb signal, my apps models are in the database, but the custom permissions (class Meta: permissions =...) aren't created. Also by looking at the verbose output of

Splitting models.py into separate modules

2007-01-18 Thread yary
Does this post still hold true- http://groups-beta.google.com/group/django-users/msg/05ed44bf585a2d09? that is, can I separate a models file into separate modules so long as I set the __all__ variable in modules/__init__.py and keep the modules in the models directory? It doesn't seem to be

Re: moving django applications

2006-11-13 Thread yary
You can set up your main site urls.py to read something like: urlpatterns = patterns('', (r'^app1/', include('app1.urls')) # Pass to app1 (r'^app2/', include('app2.urls')) # Pass to app2 ) and within app1, have a urls.py like this: urlpatterns = patterns('', (r'^view/(?P\d+)',

Django admin confuses '' with null on foreign char primary key

2006-11-04 Thread yary
While we're on the subject of null vs '' (empty string), here's a perverse case: class TestSlug(models.Model): sluggy=models.SlugField(maxlength=17, primary_key=True,blank=True,null=False, editable=True) name=models.CharField(maxlength=40) def __str__(self): return "'%s': %s"

Re: Many-to-Many with Intermediate Table

2006-11-04 Thread yary
I'm not in front of the dev machine, but I created the model in 0.95, so maybe that's a dev feature. Or I may have had a typo in a model the first time through- in fact I recall that I had a space in 'class Model C', so if the 'name clash' detection requires all models to be created at once,

Re: Many-to-Many with Intermediate Table

2006-11-03 Thread yary
Russell Keith-Magee wrote: > On 11/3/06, yary <[EMAIL PROTECTED]> wrote: > > > > The idea here is that adding a 'realation_model' option to ManyToMany > > This idea has been suggested previously, and has been rejected > previously - it has some problems when you

Askimet is for blogs (was Re: django/db/models/base.py:383: Local variable (rel) not used)

2006-11-02 Thread yary
> ...I've submitted this to trac, was rejected by akismet as spam. It's time django's trac used a local 'dspam' instance instead of relying on askimet's, because most trouble tickets don't resemble blog comments. --~--~-~--~~~---~--~~ You received this message

Re: Many-to-Many with Intermediate Table

2006-11-02 Thread yary
My previous brainstorm relied on magic- Models that look like fields? auto-synthesized composite classes!? Django went through a magic removal, adding magic won't fly. An antidote to magic is explicitness. Let's try the previous example from a different angle, spelling everything out. class

Re: Many-to-Many with Intermediate Table - How to?

2006-11-01 Thread yary
Wow, I hate being verbose and wrong at the same time in public. Take my previous post with a grain of salt while I rethink it! sorry... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post

Re: Many-to-Many with Intermediate Table - How to?

2006-11-01 Thread yary
Russell Keith-Magee wrote: ... > That said, 'm2m with intermediate' is a relatively common use case, so > if you have any neat ideas on how to represent such a structure, feel > free to suggest them. The idea has been discussed before, but no > obvious solution has emerged (the real sticking

Re: Field with null=True, blank unspecified, should allow null

2006-10-31 Thread yary
yary wrote: > Do you have an example of any project in the wild, using the django > admin, with a field "null=True, blank=False, editable=True"? I'm > curious to know the use of such a beast in an actual implementation. to clarify,I do think it is useful to have &quo

Re: Field with null=True, blank unspecified, should allow null

2006-10-31 Thread yary
James Bennett wrote: > On 10/25/06, yary <[EMAIL PROTECTED]> wrote: > > Seems that if someone says a field can be null, that implies the admin > > interface should let it be null. > > I really, really, really don't like having a system assume that one > thing I'v

Field with null=True, blank unspecified, should allow blank

2006-10-25 Thread yary
A field specified like {{{foo=ForeignKey(Bar,null=True)}}} does not allow blanks in the admin interface. Specifying {{{foo=ForeignKey(Bar,null=True,blank=True)}}} allows blanks. Seems that if someone says a field can be null, that implies the admin interface should let it be null. If for some

syncdb complaining table already exists

2006-10-24 Thread yary
Hi, new to Django- I have my data model all created. I can run syncdb once, and it creates my database schema: C:\webapp\Site>python manage.py syncdb Creating table auth_message Creating table auth_group Creating table auth_user Creating table auth_permission Creating many-to-many tables for