> BTW, if you do this repeatedly and format of those flat files is not a
> requirement it is possible to have all initial data in a form of SQL
> script. If you place it in <appdir>/sql/<appname>.sql then Django will
> include it in 'sqlall' command right after DB creation.

While I'm not in control of the file format in this case, your
suggestion will help solve a different problem I have: I use full-text
searching on some of my tables and I was manually running a little sql
script after I did a 'manage.py sqlall <app> | mysql ...':

CREATE FULLTEXT INDEX ix_ft_trade_all
    ON trade (tradeType, investIdType, investId, portfolio, book,
strategy,
              counterparty, custodian, account);
...

and then I use the where form of get_list(...,
where=["match(<index_cols>) against('<search_pattern>')"]) to search
for them in one of my views.

Your suggestion automates that step (which I forget to do quite a bit!)

> You can use the very class that is used for POSTs - MultiValueDict. It's
> in django.utils.datastructures:
>
>     from django.utils.datastructures import MultiValueDict
>     d = MultiValueDict(your_dict)

I made the change and its working fine. One thing you have to be
careful with is to build a MultiValueDict where the values are
lists/tuples. I was putting scalars in and it was interpreting strings
as sequences which caused problems in do_html2python.

-Dave


--~--~---------~--~----~------------~-------~--~----~
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 more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to