I use a middleware to detect the mobile browser and then alter the template path. This way all the core views stay the same. I use jQueryMobile to do the heavy lifting.
Here is an example of this in action in production.
http://blackbookdailydeals.com visit it with your browser then with your mobile phone.
lzantal
> --
> You received this message because you are subscribed to the Google Groups "Satchmo users" group.
> To post to this group, send email to satchm...@googlegroups.com.
> To unsubscribe from this group, send email to satchmo-user...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/satchmo-users?hl=en.
>
The story:
---------
I am working on Multi Currency
its quite finished and it works.
I have tested it on my development environment.
I installed with syncdb --all fresh and this works fine.
BUT:
---
Now I want to add it to production server. So I have to do a migration.
I want to keep the data stored in production database. (postgresql-8.4)
Short how to do a south migration:
---------------------------------
1) ./manage.py schemamigration satchmo_store.shop --init
2) ./manage.py migrate satchmo_store.shop (--fake)
3) CHANGE of models.py
4) ./manage.py schemamigration satchmo_store.shop --auto
5) ./manage.py migrate satchmo_store.shop
What app-models changed for Multi Currency?:
-------------------------------------------
Satchmo-9.0.2-py2.6.egg/product/models.py
Satchmo-9.0.2-py2.6.egg/satchmo_store.shop/models.py
How I tried to do the migration?:
--------------------------------
1) ./manage.py schemamigration satchmo_store.shop --init
2) ./manage.py migrate satchmo_store.shop --fake
[quite the same i did for Satchmo-9.0.2-py2.6.egg/product/ but let's
concentrate on satchmo_store.shop only right now.]
3)
NOW I replace the whole Satchmo-9.0.2-py2.6.egg library with my "NEW"
Multi Currency Version of Satchmo.
I removed the migrations folders in the "NEW" Version
Satchmo-9.0.2-py2.6.egg/product/migrations and
Satchmo-0.0.2-py2.6.egg/satchmo_store/shop/migrations
and replaced it in the "NEW" Multi Currency Satchmo" Version with the
migration folders from the "OLD" version, because the are up to date.
so in short: I just changed my models. (3)
4) ./manage.py schemamigration satchmo_store.shop --auto
The Problem/Error message:
-------------------------
...traceback...
django.db.utils.DatabaseError: column shop_config.currency_id does not
exist
LINE 1: ..._country_only", "shop_config"."sales_country_id",
"shop_conf...
So he is complaining about that shop_config.currency_id does not exist.
(which is a foreignkeyfield) Yeah, great. But this is the reason why I
do a migration. It did not exist in the old version. But South should
create it now. Its in the models. I already told you. When I do a fresh
database setup with syncdb --all it works.
I am really bad at migrations. What did I do wrong?
Thank you so much for your help guys!
ionic
Good point to give it a special name not to crash with official
migrations.
Will respond when things are more clear to me and tell how I solved it.
Thanks
ionic
So the solution is to do those migrations in stages.
Not trying to add a field which depends on a field which is added in the
same migration stage.
South is not directly complaining about a possible dependency issue. its
just telling the the field does not exist.
sorry for the noise!
ionic
On Mon, 2011-11-14 at 06:51 -0800, hynekcer wrote:
--change order of calls in forwards() backwards()--
this is another good info to me.
I swear I will investigate a lot of time to become a A1 south migrator!
thx for the help and support!
Ionic