[mezzanine-users] Tool for drawing mezzanine model graph

2014-04-22 Thread Wesley
Hi all,
  I am looking at mezzanine docs these days and today I find a page 
regarding model graph.

Here is the graph link: 
http://mezzanine.jupo.org/docs/_images/graph.png

So, anybody know which tool is used to generate this graph, python specific 
tool?

Thanks.
Wesley

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] Free mezzanine themes

2014-05-10 Thread Wesley
Hi guys,
  I am a little new to Mezzanine but I find it really powerful:-)
Here I have a question that are there any free mezzanine themes?
Just googled a while, seems we need to pay most of them?

Anyone know free ones? Just wanna a try cool theme customize.

Thx.
Wesley

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] Re: Free mezzanine themes

2014-05-10 Thread Wesley
Thanks:-)
I will have a look.

Wesley

在 2014年5月11日星期日UTC+8上午5时54分06秒,bors...@gmail.com写道:
>
> Le samedi 10 mai 2014 18:50:43 UTC+2, Wesley a écrit :
>>
>> Hi guys,
>>   I am a little new to Mezzanine but I find it really powerful:-)
>> Here I have a question that are there any free mezzanine themes?
>> Just googled a while, seems we need to pay most of them?
>>
>> Anyone know free ones? Just wanna a try cool theme customize.
>>
>
>  Hi,
>
> I use http://bootswatch.com/
>
> These are not strictly Mezzanine themes but it's up-to-date Bootstrap 
> themes so it's easy to integrate.
>
> Hervé
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] Mezzanine tree and right-panel display block blank box

2014-05-12 Thread Wesley
Hi guys,
   I hit a problem here.
When I unchecked 

   -  Left-hand tree
   -  Footer



from all pages, hit a problem seeing the following pic:

<https://lh3.googleusercontent.com/-l96kXh-GKlQ/U3B6cj9UQ7I/AFU/EUjRoN8seYk/s1600/mezzanine_block_tree_bug.jpg>
So, how to fix this?

Thanks.
Wesley

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] Redirect homepage template to customized html instead of pages/index.html

2014-05-13 Thread Wesley
Hi all,
  I am learning to customize homepage theme according 
to http://bitofpixels.com/blog/mezzatheming-part-2-the-homepage/
Here I hit a question that, homepage always use pages/index.html, actually, 
I have a homepage.html extends pages/index.html.

So, how to change the template name for the new added homepage(subclass 
Page just as that artical said).

Thanks.
Wesley

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] How to refer filefield src in template

2014-05-13 Thread Wesley
Hi guys,
  I hit a proble when referring filefield in template.
Here is model:
class Slide(Orderable):
'''
A slide in a slider connected to a HomePage
'''
homepage = models.ForeignKey(HomePage, related_name="slides")
image = FileField(verbose_name=_("Image"),
upload_to=upload_to("mytheme.Slide.image", "slider"),
format="Image", max_length=255, null=True, blank=True)

Here is template snippet:
{% for slide in page.homepage.slides.all %}




    {% endfor %}

It cannot find the src image, why? how to fix?

Thanks.
Wesley

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] How to refer filefield src in template

2014-05-13 Thread Wesley
Hi Josh,
  Thanks for your response.
I am sorry but the code is ok that can find the image.
Issue actually with the css that I have solved.

So, sorry for the noise.

Thanks.
Wesley

在 2014年5月13日星期二UTC+8下午9时45分02秒,Josh Cartmell写道:
>
> What ends up as the src of the img tag?
>
>
> On Tue, May 13, 2014 at 6:10 AM, Wesley >wrote:
>
>> Hi guys,
>>   I hit a proble when referring filefield in template.
>> Here is model:
>>  class Slide(Orderable):
>> '''
>> A slide in a slider connected to a HomePage
>> '''
>> homepage = models.ForeignKey(HomePage, related_name="slides")
>> image = FileField(verbose_name=_("Image"),
>> upload_to=upload_to("mytheme.Slide.image", "slider"),
>> format="Image", max_length=255, null=True, blank=True)
>>
>> Here is template snippet:
>> {% for slide in page.homepage.slides.all %}
>> 
>> 
>> > src="{{ MEDIA_URL }}{% thumbnail slide.image 1920 690 %}"  alt="">
>> 
>> {% endfor %}
>>
>> It cannot find the src image, why? how to fix?
>>
>> Thanks.
>> Wesley
>>  
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Mezzanine Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to mezzanine-use...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] Consult one design

2014-05-13 Thread Wesley
Guys,
  I am trying to customize homepage these days.

I have succeeded to make homepage editable in admin.
Here just wanna consult one design case.
Firstly, show u guys the homepage structure:

<https://lh4.googleusercontent.com/-vKo_-blDkS0/U3MTNbsv12I/AFk/QDQfNtzT05U/s1600/QQ%E5%9B%BE%E7%89%8720140514145244.jpg>

So, just see the ColumnX part, now , I wanna these columns editable during 
the admin homepage editing, that is, columns number and each column 
content, so, I think the ColumnX part should be a page, eh?

How to desigh this?

Thanks.

Wesley

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Consult one design

2014-05-14 Thread Wesley
Hi Luc,
  Just check out the package and involved to my project as App.

Set it to installed_app and in one of my template, I use {% flatblock "My 
Awesome Block" %}.
But no context displayed neither in site page nor in admin...

Here is src generated by {% flatblock "My Awesome Block" %}







Content




App




Model




Id




Fields













Edit






在 2014年5月14日星期三UTC+8下午3时12分45秒,Luc Milland写道:
>
> Hi Wesley, 
> you could use something like https://github.com/renyi/mezzanine-blocks 
> for that use. 
>
> Luc 
>
> Le mardi 13 mai 2014 à 23:58 -0700, Wesley a écrit : 
> > Guys, 
> >   I am trying to customize homepage these days. 
> > 
> > I have succeeded to make homepage editable in admin. 
> > Here just wanna consult one design case. 
> > Firstly, show u guys the homepage structure: 
> > 
> > <
> https://lh4.googleusercontent.com/-vKo_-blDkS0/U3MTNbsv12I/AFk/QDQfNtzT05U/s1600/QQ%E5%9B%BE%E7%89%8720140514145244.jpg>
>  
>
> > 
> > So, just see the ColumnX part, now , I wanna these columns editable 
> during 
> > the admin homepage editing, that is, columns number and each column 
> > content, so, I think the ColumnX part should be a page, eh? 
> > 
> > How to desigh this? 
> > 
> > Thanks. 
> > 
> > Wesley 
> > 
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Consult one design

2014-05-14 Thread Wesley
what's more, no any  css file?

在 2014年5月14日星期三UTC+8下午3时12分45秒,Luc Milland写道:
>
> Hi Wesley, 
> you could use something like https://github.com/renyi/mezzanine-blocks 
> for that use. 
>
> Luc 
>
> Le mardi 13 mai 2014 à 23:58 -0700, Wesley a écrit : 
> > Guys, 
> >   I am trying to customize homepage these days. 
> > 
> > I have succeeded to make homepage editable in admin. 
> > Here just wanna consult one design case. 
> > Firstly, show u guys the homepage structure: 
> > 
> > <
> https://lh4.googleusercontent.com/-vKo_-blDkS0/U3MTNbsv12I/AFk/QDQfNtzT05U/s1600/QQ%E5%9B%BE%E7%89%8720140514145244.jpg>
>  
>
> > 
> > So, just see the ColumnX part, now , I wanna these columns editable 
> during 
> > the admin homepage editing, that is, columns number and each column 
> > content, so, I think the ColumnX part should be a page, eh? 
> > 
> > How to desigh this? 
> > 
> > Thanks. 
> > 
> > Wesley 
> > 
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] Something about i18n

2014-05-16 Thread Wesley
Hi all,
  I get several question regarding i18n.

1. I use  python manage.py makemessages -l zh_CN to generate po file.
I see locale\zh_CN\LC_MESSAGES\django.pot under the project folder.
So, is .pot correct? I remember it's .po in the past...

2. when compiling, got this:
processing file django.po in 
D:\workspace43\Portal\locale\zh_CN\LC_MESSAGES
D:\workspace43\Portal\locale\zh_CN\LC_MESSAGES\django.po:134: duplicate 
message definition...
D:\workspace43\Portal\locale\zh_CN\LC_MESSAGES\django.po:79: ...this is the 
location of the first definition
msgfmt: found 1 fatal error

   I use poedit to open the file, indeed, has two line with same msgid, but 
in different template file.
   How this happened? or how to fix this?

3. Looked into the po file, e.g. one line like this:
#: .\mytheme\templates\base.html.py:135
msgid "Powered by"

but, actually, the line is 134 in that template, not 135
Why?

Thanks.
Wesley

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] Form page submit handler?

2014-05-21 Thread Wesley
Hi guys,
  I got a question regarding form page, that, what's the view function to 
handle form submit within the Form page?

I wanna customize the view function but didn't find the right place.

Thanks.
Wesley

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Form page submit handler?

2014-05-21 Thread Wesley
Hi Danny,
   Got that, thanks.
Seems @processor_for is mezzanine specific , not for django itself.

Wesley

在 2014年5月22日星期四UTC+8下午12时21分19秒,Danny S写道:
>
> On 22/05/2014 1:48 PM, Wesley wrote: 
> > Hi guys, 
> >I got a question regarding form page, that, what's the view function 
> > to handle form submit within the Form page? 
> > 
> > I wanna customize the view function but didn't find the right place. 
> > 
>
>
> https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/forms/page_processors.py
>  
>
> function form_processor seems to handle form submission & emailing. 
>
> > Thanks. 
> > Wesley 
>
> HTH. HAND. 
>
> Seeya. Danny. 
> -- 
> Email: mol...@gmail.com  
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] Re: Redirect homepage template to customized html instead of pages/index.html

2014-05-22 Thread Wesley
Well, actually, I did that with the way Josh Cartmell mentioned.
Thanks a lot:-)

Wesley

在 2014年5月13日星期二UTC+8下午3时09分46秒,Wesley写道:
>
> Hi all,
>   I am learning to customize homepage theme according to 
> http://bitofpixels.com/blog/mezzatheming-part-2-the-homepage/
> Here I hit a question that, homepage always use pages/index.html, 
> actually, I have a homepage.html extends pages/index.html.
>
> So, how to change the template name for the new added homepage(subclass 
> Page just as that artical said).
>
> Thanks.
> Wesley
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] how to serve static files under customized theme

2014-05-24 Thread Wesley
Hi all,
  I get a problem for my customized theme.
I have a theme app, under which I have folder static(js, img, css) and 
templates.

When deploying to nginx(production env), I have following snippet:
 
location /static/ {
root/home/mysite;
access_log  off;
log_not_found   off;
}

When set debug=False, I see imgs under theme/static/img are not available...
static files and template under theme is customized, so, I shouldn't put 
this to project static folder.
So, how to fix this?

Thanks.
Wesley

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] Re: how to serve static files under customized theme

2014-05-25 Thread Wesley
Sorry but I don't understand what you said exactly...

I have put the theme app in the highest of installed apps.
And run collectstatic then.

Static under theme app not collected to project static which I think should 
be OK.
If not, what will happened if there are same file name between project 
static and theme static files?

So, still don't know how to fix this:-(

在 2014年5月25日星期日UTC+8上午7时37分18秒,nathan写道:
>
> One of the settings to edit with a customized theme put in the installed 
> apps.  Put out in the first of your apps (the highest.) I think a python 
> manage.py collectstatic will actually put the files in your static 
> directory that you've set. The original files will always be in system wide 
> python mezzanine directory or virtualenv

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Re: how to serve static files under customized theme

2014-05-26 Thread Wesley
If a file with a particular name already exists in your project's static 
directory it will be replaced so the best practice is to always keep static 
files in some separate app.

Hi, put you comment above.
So, what do you mean by keep static files in some separate app?
I already keep my customized static file in the theme app. Or do you mean 
keep different name?

Wesley

在 2014年5月26日星期一UTC+8下午9时45分49秒,Josh Cartmell写道:
>
> Hey Wesley I would read up on how Django handles static files, 
> https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/, 
> particularly the collecstatic command part of the down the page.
>
> Basically, if your theme app is in INSTALLED_APPS, running collectstatic 
> will copy files from theme/static to your project's static directory (the 
> intention is for them to be served by your front end server from there).  
> If a file with a particular name already exists in your project's static 
> directory it will be replaced so the best practice is to always keep static 
> files in some separate app.
>
>
> On Sun, May 25, 2014 at 9:31 PM, Wesley >wrote:
>
>> Sorry but I don't understand what you said exactly...
>>
>> I have put the theme app in the highest of installed apps.
>> And run collectstatic then.
>>
>> Static under theme app not collected to project static which I think 
>> should be OK.
>> If not, what will happened if there are same file name between project 
>> static and theme static files?
>>
>> So, still don't know how to fix this:-(
>>
>> 在 2014年5月25日星期日UTC+8上午7时37分18秒,nathan写道:
>>
>>> One of the settings to edit with a customized theme put in the installed 
>>> apps.  Put out in the first of your apps (the highest.) I think a python 
>>> manage.py collectstatic will actually put the files in your static 
>>> directory that you've set. The original files will always be in system wide 
>>> python mezzanine directory or virtualenv
>>
>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Mezzanine Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to mezzanine-use...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Re: how to serve static files under customized theme

2014-05-26 Thread Wesley
Hi Josh,
  Yeah, I do think I am right in the beginning:-)
My current problem is that, I have a 404.png under theme/static/img, it's 
not available.

When I copy it to project static/img, It's OK...
So, what's the reason?

Thanks.
Wesley

在 2014年5月26日星期一UTC+8下午11时30分27秒,Josh Cartmell写道:
>
> I think putting it in your theme app is a good idea so it sounds like what 
> you are doing is correct
>
>
> On Mon, May 26, 2014 at 10:43 AM, Wesley  >wrote:
>
>> If a file with a particular name already exists in your project's static 
>> directory it will be replaced so the best practice is to always keep static 
>> files in some separate app.
>>
>> Hi, put you comment above.
>> So, what do you mean by keep static files in some separate app?
>> I already keep my customized static file in the theme app. Or do you mean 
>> keep different name?
>>
>> Wesley
>>
>> 在 2014年5月26日星期一UTC+8下午9时45分49秒,Josh Cartmell写道:
>>>
>>> Hey Wesley I would read up on how Django handles static files, 
>>> https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/, 
>>> particularly the collecstatic command part of the down the page.
>>>
>>> Basically, if your theme app is in INSTALLED_APPS, running collectstatic 
>>> will copy files from theme/static to your project's static directory (the 
>>> intention is for them to be served by your front end server from there).  
>>> If a file with a particular name already exists in your project's static 
>>> directory it will be replaced so the best practice is to always keep static 
>>> files in some separate app.
>>>
>>>
>>> On Sun, May 25, 2014 at 9:31 PM, Wesley  wrote:
>>>
>>>>  Sorry but I don't understand what you said exactly...
>>>>
>>>> I have put the theme app in the highest of installed apps.
>>>> And run collectstatic then.
>>>>
>>>> Static under theme app not collected to project static which I think 
>>>> should be OK.
>>>> If not, what will happened if there are same file name between project 
>>>> static and theme static files?
>>>>
>>>> So, still don't know how to fix this:-(
>>>>
>>>> 在 2014年5月25日星期日UTC+8上午7时37分18秒,nathan写道:
>>>>
>>>>> One of the settings to edit with a customized theme put in the 
>>>>> installed apps.  Put out in the first of your apps (the highest.) I think 
>>>>> a 
>>>>> python manage.py collectstatic will actually put the files in your static 
>>>>> directory that you've set. The original files will always be in system 
>>>>> wide 
>>>>> python mezzanine directory or virtualenv
>>>>
>>>>  -- 
>>>> You received this message because you are subscribed to the Google 
>>>> Groups "Mezzanine Users" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>> an email to mezzanine-use...@googlegroups.com.
>>>>
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Mezzanine Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to mezzanine-use...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] How to add cartridge to existing Mezzanine project

2014-08-21 Thread Wesley
Hi guys,
   I have a question regarding adding cartridge to existing Mezzanine 
project.

I have a site based on Mezzanine now, and wanna add new functionality to 
support shopping cart.

I a little new to Mezzanine, so, how to add cartridge easily?  Then, I can 
 edit product info within admin and see products list from website.

Thanks a lot.
Wesley

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] How to add cartridge to existing Mezzanine project

2014-08-21 Thread Wesley
Thanks for your answer.
So, I diffing settings and urls.py, and add those lost lines compared to 
Cartridge's.

Then, run python manage.py migrate(I see there is migrations folder under 
cartridge), and got error here:

Running migrations for mytheme:
- Nothing to migrate.
 - Loading initial data for mytheme.
Installed 0 object(s) from 0 fixture(s)
Running migrations for mezzanine_blocks:
- Nothing to migrate.
 - Loading initial data for mezzanine_blocks.
Installed 0 object(s) from 0 fixture(s)
Running migrations for shop:
 - Migrating forwards to 0025_auto__add_field_order_site.
 > shop:0001_initial
TypeError: type() argument 1 must be string, not unicode

So, what's wrong here? shouldn't I migrate here?

versions here:
>>> mezzanine.__version__
'3.1.9'
>>> import cartridge
>>> cartridge.__version__
'0.9.5'
>>>

Thanks.


在 2014年8月21日星期四UTC+8下午6时44分00秒,Stephen McDonald写道:
>
> Have a look in the cartridge/project_template directory - settings.py and 
> urls.py will contain everything needed.
>
>
> On Thu, Aug 21, 2014 at 7:15 PM, Wesley > 
> wrote:
>
>> Hi guys,
>>I have a question regarding adding cartridge to existing Mezzanine 
>> project.
>>
>> I have a site based on Mezzanine now, and wanna add new functionality to 
>> support shopping cart.
>>
>> I a little new to Mezzanine, so, how to add cartridge easily?  Then, I 
>> can  edit product info within admin and see products list from website.
>>
>> Thanks a lot.
>> Wesley
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Mezzanine Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to mezzanine-use...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Stephen McDonald
> http://jupo.org 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] How to add cartridge to existing Mezzanine project

2014-08-21 Thread Wesley
Thanks for your answer.
So, I diffing settings and urls.py, and add those lost lines compared to 
Cartridge's.

Then, run python manage.py migrate(I see there is migrations folder under 
cartridge), and got error here:

Running migrations for mytheme:
- Nothing to migrate.
 - Loading initial data for mytheme.
Installed 0 object(s) from 0 fixture(s)
Running migrations for mezzanine_blocks:
- Nothing to migrate.
 - Loading initial data for mezzanine_blocks.
Installed 0 object(s) from 0 fixture(s)
Running migrations for shop:
 - Migrating forwards to 0025_auto__add_field_order_site.
 > shop:0001_initial
TypeError: type() argument 1 must be string, not unicode

So, what's wrong here? shouldn't I migrate here?

versions here:
>>> mezzanine.__version__
'3.1.9'
>>> import cartridge
>>> cartridge.__version__
'0.9.5'
>>>

Thanks.


在 2014年8月21日星期四UTC+8下午6时44分00秒,Stephen McDonald写道:
>
> Have a look in the cartridge/project_template directory - settings.py and 
> urls.py will contain everything needed.
>
>
> On Thu, Aug 21, 2014 at 7:15 PM, Wesley > 
> wrote:
>
>> Hi guys,
>>I have a question regarding adding cartridge to existing Mezzanine 
>> project.
>>
>> I have a site based on Mezzanine now, and wanna add new functionality to 
>> support shopping cart.
>>
>> I a little new to Mezzanine, so, how to add cartridge easily?  Then, I 
>> can  edit product info within admin and see products list from website.
>>
>> Thanks a lot.
>> Wesley
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Mezzanine Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to mezzanine-use...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Stephen McDonald
> http://jupo.org 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] How to add cartridge to existing Mezzanine project

2014-08-21 Thread Wesley
Somebody know this issue?

在 2014年8月21日星期四UTC+8下午9时36分59秒,Wesley写道:
>
> Thanks for your answer.
> So, I diffing settings and urls.py, and add those lost lines compared to 
> Cartridge's.
>
> Then, run python manage.py migrate(I see there is migrations folder under 
> cartridge), and got error here:
>
> Running migrations for mytheme:
> - Nothing to migrate.
>  - Loading initial data for mytheme.
> Installed 0 object(s) from 0 fixture(s)
> Running migrations for mezzanine_blocks:
> - Nothing to migrate.
>  - Loading initial data for mezzanine_blocks.
> Installed 0 object(s) from 0 fixture(s)
> Running migrations for shop:
>  - Migrating forwards to 0025_auto__add_field_order_site.
>  > shop:0001_initial
> TypeError: type() argument 1 must be string, not unicode
>
> So, what's wrong here? shouldn't I migrate here?
>
> versions here:
> >>> mezzanine.__version__
> '3.1.9'
> >>> import cartridge
> >>> cartridge.__version__
> '0.9.5'
> >>>
>
> Thanks.
>
>
> 在 2014年8月21日星期四UTC+8下午6时44分00秒,Stephen McDonald写道:
>>
>> Have a look in the cartridge/project_template directory - settings.py and 
>> urls.py will contain everything needed.
>>
>>
>> On Thu, Aug 21, 2014 at 7:15 PM, Wesley  wrote:
>>
>>> Hi guys,
>>>I have a question regarding adding cartridge to existing Mezzanine 
>>> project.
>>>
>>> I have a site based on Mezzanine now, and wanna add new functionality to 
>>> support shopping cart.
>>>
>>> I a little new to Mezzanine, so, how to add cartridge easily?  Then, I 
>>> can  edit product info within admin and see products list from website.
>>>
>>> Thanks a lot.
>>> Wesley
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Mezzanine Users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to mezzanine-use...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> -- 
>> Stephen McDonald
>> http://jupo.org 
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] How to add cartridge to existing Mezzanine project

2014-08-21 Thread Wesley
Add that line to the top of 0025_auto__add_field_order_site. 
But with the same error ...

在 2014年8月22日星期五UTC+8上午9时58分19秒,Stephen McDonald写道:
>
> Can you find that migration file and try adding this line to the very top 
> of it, and let us know if that resolves it?
>
> from __future__ import unicode_literals
>
>
>
> On Thu, Aug 21, 2014 at 11:36 PM, Wesley > 
> wrote:
>
>> Thanks for your answer.
>> So, I diffing settings and urls.py, and add those lost lines compared to 
>> Cartridge's.
>>
>> Then, run python manage.py migrate(I see there is migrations folder under 
>> cartridge), and got error here:
>>
>> Running migrations for mytheme:
>> - Nothing to migrate.
>>  - Loading initial data for mytheme.
>> Installed 0 object(s) from 0 fixture(s)
>> Running migrations for mezzanine_blocks:
>> - Nothing to migrate.
>>  - Loading initial data for mezzanine_blocks.
>> Installed 0 object(s) from 0 fixture(s)
>> Running migrations for shop:
>>  - Migrating forwards to 0025_auto__add_field_order_site.
>>  > shop:0001_initial
>> TypeError: type() argument 1 must be string, not unicode
>>
>> So, what's wrong here? shouldn't I migrate here?
>>
>> versions here:
>> >>> mezzanine.__version__
>> '3.1.9'
>> >>> import cartridge
>> >>> cartridge.__version__
>> '0.9.5'
>> >>>
>>
>> Thanks.
>>
>>
>> 在 2014年8月21日星期四UTC+8下午6时44分00秒,Stephen McDonald写道:
>>
>>> Have a look in the cartridge/project_template directory - settings.py 
>>> and urls.py will contain everything needed.
>>>
>>>
>>> On Thu, Aug 21, 2014 at 7:15 PM, Wesley  wrote:
>>>
>>>> Hi guys,
>>>>I have a question regarding adding cartridge to existing Mezzanine 
>>>> project.
>>>>
>>>> I have a site based on Mezzanine now, and wanna add new functionality 
>>>> to support shopping cart.
>>>>
>>>> I a little new to Mezzanine, so, how to add cartridge easily?  Then, I 
>>>> can  edit product info within admin and see products list from website.
>>>>
>>>> Thanks a lot.
>>>> Wesley
>>>>
>>>> -- 
>>>> You received this message because you are subscribed to the Google 
>>>> Groups "Mezzanine Users" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>> an email to mezzanine-use...@googlegroups.com.
>>>>
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>
>>>
>>> -- 
>>> Stephen McDonald
>>> http://jupo.org 
>>>
>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Mezzanine Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to mezzanine-use...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Stephen McDonald
> http://jupo.org 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] How to add cartridge to existing Mezzanine project

2014-08-21 Thread Wesley
Now, because I add cartridge to existing project.
So, I drop the Cartridge's migrations folder. 
Then, instead of migrate, i just use python manage.py syncdb
Seems it's OK.

Is what I do correct?


在 2014年8月22日星期五UTC+8上午9时58分19秒,Stephen McDonald写道:
>
> Can you find that migration file and try adding this line to the very top 
> of it, and let us know if that resolves it?
>
> from __future__ import unicode_literals
>
>
>
> On Thu, Aug 21, 2014 at 11:36 PM, Wesley > 
> wrote:
>
>> Thanks for your answer.
>> So, I diffing settings and urls.py, and add those lost lines compared to 
>> Cartridge's.
>>
>> Then, run python manage.py migrate(I see there is migrations folder under 
>> cartridge), and got error here:
>>
>> Running migrations for mytheme:
>> - Nothing to migrate.
>>  - Loading initial data for mytheme.
>> Installed 0 object(s) from 0 fixture(s)
>> Running migrations for mezzanine_blocks:
>> - Nothing to migrate.
>>  - Loading initial data for mezzanine_blocks.
>> Installed 0 object(s) from 0 fixture(s)
>> Running migrations for shop:
>>  - Migrating forwards to 0025_auto__add_field_order_site.
>>  > shop:0001_initial
>> TypeError: type() argument 1 must be string, not unicode
>>
>> So, what's wrong here? shouldn't I migrate here?
>>
>> versions here:
>> >>> mezzanine.__version__
>> '3.1.9'
>> >>> import cartridge
>> >>> cartridge.__version__
>> '0.9.5'
>> >>>
>>
>> Thanks.
>>
>>
>> 在 2014年8月21日星期四UTC+8下午6时44分00秒,Stephen McDonald写道:
>>
>>> Have a look in the cartridge/project_template directory - settings.py 
>>> and urls.py will contain everything needed.
>>>
>>>
>>> On Thu, Aug 21, 2014 at 7:15 PM, Wesley  wrote:
>>>
>>>> Hi guys,
>>>>I have a question regarding adding cartridge to existing Mezzanine 
>>>> project.
>>>>
>>>> I have a site based on Mezzanine now, and wanna add new functionality 
>>>> to support shopping cart.
>>>>
>>>> I a little new to Mezzanine, so, how to add cartridge easily?  Then, I 
>>>> can  edit product info within admin and see products list from website.
>>>>
>>>> Thanks a lot.
>>>> Wesley
>>>>
>>>> -- 
>>>> You received this message because you are subscribed to the Google 
>>>> Groups "Mezzanine Users" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>> an email to mezzanine-use...@googlegroups.com.
>>>>
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>
>>>
>>> -- 
>>> Stephen McDonald
>>> http://jupo.org 
>>>
>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Mezzanine Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to mezzanine-use...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Stephen McDonald
> http://jupo.org 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] How to add cartridge to existing Mezzanine project

2014-08-24 Thread Wesley
Hi Josh,
   Here is output for running migrate with fake option:
Running migrations for shop:
 - Migrating forwards to 0025_auto__add_field_order_site.
 > shop:0001_initial
   (faked)
 > 
shop:0002_auto__add_field_category_price_max__add_field_category_sale__add_field
   (faked)
 > shop:0003_auto
   (faked)
 > 
shop:0004_auto__del_field_product__keywords__add_field_product_site__add_field_p
   (faked)
 > 
shop:0005_auto__add_field_product_rating_count__add_field_product_rating_average
   (faked)
 > shop:0006_auto__chg_field_product_content__chg_field_category_content
   (faked)
 > shop:0007_auto__add_field_productimage__order
   (faked)
 > shop:0008_auto__add_field_order_transaction_id
   (faked)
 > shop:0009_auto__add_field_product_gen_description
   (faked)
 > shop:0010_auto__chg_field_product_title__chg_field_product_slug
   (faked)
 > shop:0011_auto__add_uses_remaining
   (faked)
 > shop:0012_allow_100_percent_discount
   (faked)
 > shop:0012_auto__chg_field_cart_last_updated
   (faked)
 > 
shop:0013_auto__chg_field_productvariation_sku__add_field_product_num_in_stock
   (faked)
 > shop:0014_stock_data
   (faked)
 > shop:0015_add_field_product_sku
   (faked)
 > shop:0016_add_field_product__meta_title
   (faked)
 > shop:0017_auto__add_field_category_featured_image
   (faked)
 > shop:0018_auto__add_field_product_in_sitemap
   (faked)
 > shop:0019_auto__add_field_order_tax_type__add_field_order_tax_total
   (faked)
 > shop:0020_auto__add_field_product_rating_sum
   (faked)
 > shop:0021_auto__chg_field_cartitem_url
   (faked)
 > 
shop:0022_auto__chg_field_cartitem_description__chg_field_orderitem_description
   (faked)
 > shop:0023_auto__add_field_product_created__add_field_product_updated
   (faked)
 > shop:0024_auto__chg_field_product_rating__chg_field_product_keywords
   (faked)
 > shop:0025_auto__add_field_order_site
   (faked)

so, what's the fake here means? only for check migration .py files?

BTW, I find something interesting today.
I mentioned I drop migrations and directly use syncdb in my previous mail 
and you say that should work.

But, I check code and find one db field of Product, i.e. rating_average, I 
cannot find this guy in models.py but only in those migration scripts.
Does this mean I have to do migration operation? Why this field not coded 
directly in models definition?

Thanks.
Wesl 

在 2014年8月22日星期五UTC+8下午10时16分10秒,Josh Cartmell写道:
>
> Hey Wesley, that should work, but if you ever upgrade to a newer version 
> of Cartridge and need to run migrations you will run into issues.
>
> What happens if you run:
> python manage.py migrate cartridge --fake
>
>
> On Fri, Aug 22, 2014 at 1:53 AM, Wesley > 
> wrote:
>
>> Now, because I add cartridge to existing project.
>> So, I drop the Cartridge's migrations folder. 
>> Then, instead of migrate, i just use python manage.py syncdb
>> Seems it's OK.
>>
>> Is what I do correct?
>>
>>
>> 在 2014年8月22日星期五UTC+8上午9时58分19秒,Stephen McDonald写道:
>>>
>>> Can you find that migration file and try adding this line to the very 
>>> top of it, and let us know if that resolves it?
>>>
>>> from __future__ import unicode_literals
>>>
>>>
>>>
>>> On Thu, Aug 21, 2014 at 11:36 PM, Wesley  wrote:
>>>
>>>> Thanks for your answer.
>>>> So, I diffing settings and urls.py, and add those lost lines compared 
>>>> to Cartridge's.
>>>>
>>>> Then, run python manage.py migrate(I see there is migrations folder 
>>>> under cartridge), and got error here:
>>>>
>>>> Running migrations for mytheme:
>>>> - Nothing to migrate.
>>>>  - Loading initial data for mytheme.
>>>> Installed 0 object(s) from 0 fixture(s)
>>>> Running migrations for mezzanine_blocks:
>>>> - Nothing to migrate.
>>>>  - Loading initial data for mezzanine_blocks.
>>>> Installed 0 object(s) from 0 fixture(s)
>>>> Running migrations for shop:
>>>>  - Migrating forwards to 0025_auto__add_field_order_site.
>>>>  > shop:0001_initial
>>>> TypeError: type() argument 1 must be string, not unicode
>>>>
>>>> So, what's wrong here? shouldn't I migrate here?
>>>>
>>>> versions here:
>>>> >>> mezzanine.__version__
>>>> '3.1.9'
>>>> >>> import cartridge
>>>> >>> cartridge.__version__
>>>> '0.9.5'
>>>> >>>
>>>>
>>>> Thanks.
>>>>
>>>>
>>>> 在 2014年8月21日星期四UTC+8下午6时44分00秒,Stephen McD

[mezzanine-users] how to remove billing details for checkout first step

2014-08-25 Thread Wesley
Hi guys,
  I got one question here regarding checkout process.
I see there is one option SHOP_PAYMENT_STEP_ENABLED that I can remove 
payment step by setting this guy to False.

Then, I wanna disable billing details for the first step, i.e. only display 
shipping details, additional instructions.
I search the docs and didn't find a option settings to archieve this. I 
there is one, could you please tell me here?

So, I copied cartridge code and do some modification.
For example:
1.billing_shipping.html
change some block to here:



{% trans "Delivery Details" %}

{% fields_for form.shipping_detail_fields 
%}shit
{% fields_for form.additional_instructions_field %}
{% fields_for form.remember_field %}


re-run server, no Billing Details any more, however, there is also no any 
other field, saying, shipping detailed fields,additional instruction field 
.etc

2.then, change OrderForm class:
class Meta:
model = Order
fields = ([f.name for f in Order._meta.fields if
   #f.name.startswith("billing_detail") or
   f.name.startswith("shipping_detail")] +
   ["additional_instructions", "discount_code"])
you see I comment the line related to billing detail.

unfortunately, the same issue as above...

So, what should I do here? any easy way?

Thanks.
Wesley

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] how to remove billing details for checkout first step

2014-08-25 Thread Wesley
Hi guys,
  I got one question here regarding checkout process.
I see there is one option SHOP_PAYMENT_STEP_ENABLED that I can remove 
payment step by setting this guy to False.

Then, I wanna disable billing details for the first step, i.e. only display 
shipping details, additional instructions.
I search the docs and didn't find a option settings to archieve this. I 
there is one, could you please tell me here?

So, I copied cartridge code and do some modification.
For example:
1.billing_shipping.html
change some block to here:



{% trans "Delivery Details" %}

{% fields_for form.shipping_detail_fields 
%}shit
{% fields_for form.additional_instructions_field %}
{% fields_for form.remember_field %}


re-run server, no Billing Details any more, however, there is also no any 
other field, saying, shipping detailed fields,additional instruction field 
.etc

2.then, change OrderForm class:
class Meta:
model = Order
fields = ([f.name for f in Order._meta.fields if
   #f.name.startswith("billing_detail") or
   f.name.startswith("shipping_detail")] +
   ["additional_instructions", "discount_code"])
you see I comment the line related to billing detail.

unfortunately, the same issue as above...

So, what should I do here? any easy way?

Thanks.
Wesley

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] how to remove billing details for checkout first step

2014-08-25 Thread Wesley
Hi Josh,
  I think you misunderstand.
I wanna remove billing fields, not shipping fields, for my situation here, 
shipping fields with additional instruction field is enough.

And I just have a try to remove the div you mentioned, then, It keeps 
posting errors when press next button although I cannot find where is wrong 
I filled in.


在 2014年8月25日星期一UTC+8下午10时34分11秒,Josh Cartmell写道:
>
> Hey Wesley, try removing this  from the shipping 
> fields.  That class is hidden by default and there is some logic that shows 
> it under certain circumstances.
>
> My understanding is that you want it always visible.
>
>
> On Mon, Aug 25, 2014 at 7:31 AM, Wesley > 
> wrote:
>
>> Hi guys,
>>   I got one question here regarding checkout process.
>> I see there is one option SHOP_PAYMENT_STEP_ENABLED that I can remove 
>> payment step by setting this guy to False.
>>
>> Then, I wanna disable billing details for the first step, i.e. only 
>> display shipping details, additional instructions.
>> I search the docs and didn't find a option settings to archieve this. I 
>> there is one, could you please tell me here?
>>
>> So, I copied cartridge code and do some modification.
>> For example:
>> 1.billing_shipping.html
>> change some block to here:
>> 
>>
>> 
>> {% trans "Delivery Details" %}
>> 
>> {% fields_for form.shipping_detail_fields 
>> %}shit
>> {% fields_for form.additional_instructions_field %}
>> {% fields_for form.remember_field %}
>> 
>>
>> re-run server, no Billing Details any more, however, there is also no any 
>> other field, saying, shipping detailed fields,additional instruction field 
>> .etc
>>
>> 2.then, change OrderForm class:
>> class Meta:
>> model = Order
>> fields = ([f.name for f in Order._meta.fields if
>>#f.name.startswith("billing_detail") or
>>f.name.startswith("shipping_detail")] +
>>["additional_instructions", "discount_code"])
>> you see I comment the line related to billing detail.
>>
>> unfortunately, the same issue as above...
>>
>> So, what should I do here? any easy way?
>>
>> Thanks.
>> Wesley
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Mezzanine Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to mezzanine-use...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] LC_MONETARY is required?

2014-08-26 Thread Wesley
Hi guys,
   I hit a problem today.

I move my project to one VPS located at LA. 

When running, it keeps logging "ImproperlyConfigured: Invalid currency 
locale specified for SHOP_CURRENCY_LOCALE: ''. You'll need to set the 
locale for your system, or configure the SHOP_CURRENCY_LOCALE setting in 
your settings module.".

Looking at cartridge source:

def set_locale():
"""
Sets the locale for currency formatting.
"""
currency_locale = str(settings.SHOP_CURRENCY_LOCALE)
try:
if setlocale(LC_MONETARY, currency_locale) == "C":
# C locale doesn't contain a suitable value for "frac_digits".
raise
except:
msg = _("Invalid currency locale specified for 
SHOP_CURRENCY_LOCALE: "
"'%s'. You'll need to set the locale for your system, or "
"configure the SHOP_CURRENCY_LOCALE setting in your 
settings "
"module.")
raise ImproperlyConfigured(msg % currency_locale)

There is no SHOP_CURRENCY_LOCALE in my settings.py, but It's OK when my 
code runs upon WIN7 desktop.

My VPS is centos 6.5, so, how this happened? What should I do to fix?

Thanks.
Wesley

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] Re: LC_MONETARY is required?

2014-08-26 Thread Wesley
Sorry, I find answer 
from https://groups.google.com/forum/#!topic/mezzanine-users/ZlXkZCftEKg.

在 2014年8月26日星期二UTC+8下午8时10分52秒,Wesley写道:
>
> Hi guys,
>I hit a problem today.
>
> I move my project to one VPS located at LA. 
>
> When running, it keeps logging "ImproperlyConfigured: Invalid currency 
> locale specified for SHOP_CURRENCY_LOCALE: ''. You'll need to set the 
> locale for your system, or configure the SHOP_CURRENCY_LOCALE setting in 
> your settings module.".
>
> Looking at cartridge source:
>
> def set_locale():
> """
> Sets the locale for currency formatting.
> """
> currency_locale = str(settings.SHOP_CURRENCY_LOCALE)
> try:
> if setlocale(LC_MONETARY, currency_locale) == "C":
> # C locale doesn't contain a suitable value for "frac_digits".
> raise
> except:
> msg = _("Invalid currency locale specified for 
> SHOP_CURRENCY_LOCALE: "
> "'%s'. You'll need to set the locale for your system, or "
> "configure the SHOP_CURRENCY_LOCALE setting in your 
> settings "
> "module.")
> raise ImproperlyConfigured(msg % currency_locale)
>
> There is no SHOP_CURRENCY_LOCALE in my settings.py, but It's OK when my 
> code runs upon WIN7 desktop.
>
> My VPS is centos 6.5, so, how this happened? What should I do to fix?
>
> Thanks.
> Wesley
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] error happened when serving two mezzanine sites with nginx+uwsgi

2014-08-27 Thread Wesley

Hi guys,
   I hit a problem when using nginx+uwsgi to serve two mezzanine sites upon 
one VPS.
I use virtualenvwrapper to create a env with python2.7.6, note that 
system(centos6.5) has default python2.6.

Here is my uwsgi.xml:

  127.0.0.1:9000
  100
  true
  /usr/local/nginx/uwsgi.pid
  8
  /home/Portal
  /home
  wsgi
  true
  true
  true
  true
  6048
  /home/django.log


here is django uwsgi files included in nginx conf:
1. django_uwsgi.xml:
server {
listen  80;
server_name happydiaosi.com;
location / {
uwsgi_pass   127.0.0.1:9000;
include uwsgi_params;
uwsgi_param UWSGI_CHDIR /home/Portal;
uwsgi_param UWSGI_SCRIPT wsgi;
uwsgi_param UWSGI_PYHOME /home/pyvirenvs/py276;
#uwsgi_param UWSGI_PYHOME /home/pyvirenvs/easonportal;
#uwsgi_param UWSGI_PYHOME /usr/lib64/python2.6;
   access_log  off;
}
location /static/ {
root/home/Portal/;
access_log  off;
log_not_found   off;
autoindex on;
}
 }

2. django_uwsgi2.xml 
# Django project
server {
listen  80;
server_name eason.happydiaosi.com;
location / {
uwsgi_pass   127.0.0.1:9000;
include uwsgi_params;
uwsgi_param UWSGI_CHDIR /home/EasonPortal;
uwsgi_param UWSGI_SCRIPT wsgi;
uwsgi_param UWSGI_PYHOME /home/pyvirenvs/py276;
#uwsgi_param UWSGI_PYHOME /home/pyvirenvs/easonportal;
#uwsgi_param UWSGI_PYHOME /usr/lib64/python2.6;
   access_log  off;
}
location /static/ {
root/home/EasonPortal/;
access_log  off;
log_not_found   off;
}
 }

So, after I start uwsgi and nginx, when access from browser, it raises:
Traceback (most recent call last):
  File "/home/EasonPortal/wsgi.py", line 16, in 
from django.core.wsgi import get_wsgi_application
ImportError: No module named django.core.wsgi

actually, within the py276, I can import .
So,here is sys.path of py276: 
(py276)[root@show python2.7]# python
Python 2.7.6 (default, Aug 27 2014, 02:35:36) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
[31326 refs]
>>> sys.path
['', '/home/pyvirenvs/py276/lib/python27.zip', 
'/home/pyvirenvs/py276/lib/python2.7', 
'/home/pyvirenvs/py276/lib/python2.7/plat-linux2', 
'/home/pyvirenvs/py276/lib/python2.7/lib-tk', 
'/home/pyvirenvs/py276/lib/python2.7/lib-old', 
'/home/pyvirenvs/py276/lib/python2.7/lib-dynload', 
'/usr/local/lib/python2.7', '/usr/local/lib/python2.7/plat-linux2', 
'/usr/local/lib/python2.7/lib-tk', 
'/home/pyvirenvs/py276/lib/python2.7/site-packages']

And, here is output from wsgi.py(I add code to print sys.path in wsgi.py):

['/home/pyvirenvs/py276/lib/python2.6', '/home/EasonPortal', 
'/usr/lib64/python26.zip', '/usr/lib64/python2.6', 
'/usr/lib64/python2.6/plat-linux2', '/usr/lib64/python2.6/lib-tk', 
'/usr/lib64/python2.6/lib-old', '/usr/lib64/python2.6/lib-dynload', 
u'/home']


So, why the path for wsgi looks like above? why everytime pointed to 
python26 which doesn't exist,say,/home/pyvirenvs/py276/lib/python2.6,
it should be python2.7 under /home/pyvirenvs/py276/lib, not python2.6...

What wrong here? Anything wrong with my uwsgi.xml or django_uwsgi.conf 
files?

Thanks.
Wesley

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] error happened when serving two mezzanine sites with nginx+uwsgi

2014-08-27 Thread Wesley
Hi Matt,
   Thanks for your answer.
I solved the problem.

The reason is my uwsgi is installed upon system python2.6, I haven't 
installed for the virtual env python2.7.
So, to fix this:
1. activate the virtual env
2. pip install uwsgi
3. run uwsgi from the virtual env

Thanks.
Wesley

在 2014年8月28日星期四UTC+8上午1时31分57秒,Matt Gushee写道:
>
> Hi, Wesley-- 
>
> I can't claim to be a uWSGI expert (can anyone? ;-) ), but I do have a 
> mezzanine site running with uWSGI & nginx. My setup is quite different 
> from yours (e.g. my OS is FreeBSD, and though I have only one 
> Django-based site, I'm also hosting a couple of other sites that are 
> not Python-based at all), so I don't know that my configuration will 
> help you. 
>
> But I do have a couple of questions for you. 
>
> 1) Have you read this tutorial? 
> http://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html 
>
> 2) Where is your uWSGI installed? Is it installed in your virtualenv, 
> or in your system-wide python library, or is a standalone build? The 
> above tutorial recommends installing it in your virtualenv. I am using 
> a system-wide standalone version, and it works fine; the main reason I 
> do that is because of the non-python sites. It may also be relevant 
> that unlike most Linux distros, FreeBSD does not assume that you have 
> Python installed at all, let alone what version of Python you have or 
> where it is located. Anyway, I have a wild guess about this: if you 
> are using a system-wide version of uWSGI integrated into the Python 
> library, perhaps it thinks your Python executable is 2.6. 
>
> Beyond that ... I'm hesitant to say that your config looks wrong, but 
> I'm unfamiliar with your approach - especially running multiple apps 
> with one uWSGI config, using the Nginx config to distinguish between 
> them. Where did you learn to do that? I run uWSGI in emperor mode, 
> with a separate config file for each application. 
>
> It does appear to me that some of the variables being passed from 
> Nginx are redundant. Although none of them seem obviously relevant to 
> your issue, I think eliminating duplication would make it easier to 
> reason about the problem. E.g. define PYHOME once in the uWSGI config 
> instead of twice in the Nginx config. Also,  a minor point, but are 
> you sure there is a variable called UWSGI_SCRIPT? I can't find it 
> listed in the uWSGI documentation (which may or may not mean it isn't 
> there ;-) ). 
>
> Hope that helps a bit. 
>
> -- 
> Matt Gushee 
>
> On Wed, Aug 27, 2014 at 5:11 AM, Wesley > 
> wrote: 
> > 
> > Hi guys, 
> >I hit a problem when using nginx+uwsgi to serve two mezzanine sites 
> upon 
> > one VPS. 
> > I use virtualenvwrapper to create a env with python2.7.6, note that 
> > system(centos6.5) has default python2.6. 
> > 
> > Here is my uwsgi.xml: 
> >  
> >   127.0.0.1:9000 
> >   100 
> >   true 
> >   /usr/local/nginx/uwsgi.pid 
> >   8 
> >   /home/Portal 
> >   /home 
> >   wsgi 
> >   true 
> >   true 
> >   true 
> >   true 
> >   6048 
> >   /home/django.log 
> >  
> > 
> > here is django uwsgi files included in nginx conf: 
> > 1. django_uwsgi.xml: 
> > server { 
> > listen  80; 
> > server_name happydiaosi.com; 
> > location / { 
> > uwsgi_pass   127.0.0.1:9000; 
> > include uwsgi_params; 
> > uwsgi_param UWSGI_CHDIR /home/Portal; 
> > uwsgi_param UWSGI_SCRIPT wsgi; 
> > uwsgi_param UWSGI_PYHOME /home/pyvirenvs/py276; 
> > #uwsgi_param UWSGI_PYHOME /home/pyvirenvs/easonportal; 
> > #uwsgi_param UWSGI_PYHOME /usr/lib64/python2.6; 
> >access_log  off; 
> > } 
> > location /static/ { 
> > root/home/Portal/; 
> > access_log  off; 
> > log_not_found   off; 
> > autoindex on; 
> > } 
> >  } 
> > 
> > 2. django_uwsgi2.xml 
> > # Django project 
> > server { 
> > listen  80; 
> > server_name eason.happydiaosi.com; 
> > location / { 
> > uwsgi_pass   127.0.0.1:9000; 
> > include uwsgi_params; 
> > uwsgi_param UWSGI_CHDIR /home/EasonPortal; 
> > uwsgi_param UWSGI_SCRIPT wsgi; 
> > uwsgi_param UWSGI_PYHOME /home/pyvirenvs/py276; 
> > #uwsgi_param UWSGI_PYHOME /home/pyvirenvs/easonportal; 
> > #uwsgi_param UWSGI_PYHOME /

[mezzanine-users] django app to generate HTML tables and charts according to statistic data

2014-08-31 Thread Wesley
Hi all,
   I know this is not limited to Mezzanine, maybe more about Django.
But I am learning Mezzanine these days, so post here firstly to see if you 
guys could give any suggestion.

I wanna consult with you guys about django plugin to generate statistical 
charts.

For example, I wanna give a summary about sale quantity per month, per week 
.etc, according to database tables.

Any existing django app to do this?

Thanks.
Wesley

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Mezzanine mobile site

2014-09-01 Thread Wesley
Hi Josh,
  Sorry for the late response.
So, I just have a site upon Mezzanine, and create some new templates 
extending mezzanine's page.html .etc
I am not using Bootstrap explicitly.

So, when I resize my browser window to a size similar to a cell phone, I 
see there is sometimes a scroll bar at the screen bottom.

I see there is an app named mezzanine.mobile, is this guy related to making 
mezzanine mobile site?

Thanks.
Wesley

在 2014年7月1日星期二UTC+8下午9时43分44秒,Josh Cartmell写道:
>
> Hey Wesley, is the existing site Mezzanine?  Was it build using 
> Bootstrap?  If the answers to those two questions are yes I would recommend 
> just using the responsive features of Bootstrap to just have one site that 
> looks good on multiple platforms.
>
>
> On Tue, Jul 1, 2014 at 9:29 AM, Ni Wesley > 
> wrote:
>
>> Hi all, 
>>   I have a question about the way to generate mobile site from existing 
>> desktop web site. 
>> Is there any easy way for mezzanine to do this? 
>> If has,could you please give a short guide for it? 
>>
>> Thanks. 
>> Wesley
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Mezzanine Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to mezzanine-use...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] Cartridge support import/export products from

2014-09-16 Thread Wesley
Hi guys,
These days I am trying to do some i18n work.
And I see some words in django.po of Cartridge that import or export 
products from csv.

So, does Cartridge support import/export products from/to csv files?
I look at admin page but with no lucky to find page or buttons for this 
functionality.

Thanks.
Wesley

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Cartridge support import/export products from

2014-09-18 Thread Wesley
Hi,
  Thanks.
Comes out I should use something like python manage.py product_db 
--export/import csvfile.

I know loaddata, but usually I use this guy to copy env, i.e. dumpdata from 
another setup and loaddata upon a new setup.
Also, I can directly dump database and load the dump file then.

Thanks.
Wesley


>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] Extend Cartridge to be a shop platform

2014-09-18 Thread Wesley
Hi guys,
   These days I am trying to use Cartridge, and it's indeed a very good 
project.
Today one flash comes to be that is it easy to extend Cartridge to be a 
shop platform?

I mean, currently, a Mezzanine site with Cartridge installed, work as a 
single shop, e.g. login with admin user, add product .etc.

So, assume we setup a new website, there are two Companies, A and B, now A 
can login the site and add their products, 

in the meantime, B should also login and add B's products and cannot view 
A's products.

So, is it easy to do this or any existing apps? 

Thanks.
Wesley

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Extend Cartridge to be a shop platform

2014-09-21 Thread Wesley
Hi Josh,
   Thanks for your reply.
I look at the multi-tenancy part.
I think it's not what I wanted.

multi-tenancy is used for serving multiple sites within one project 
instance. And key point is upon host matching.
And, this suits to different hostnames, for example, two hostnames, 
example1.com and example2.com,  User1 access example1.com and user2 access 
example2.com
This is OK when accessing different sites.

My requirement is quite different users login the same site(domain name), 
so, this is different from the above scenario, I think I need to design 
different organizations with their admin can login to add their products 
and their own related staff.
I don't know if anyone has developed this or any existing apps there.

Thanks.
Wesley


Hey Wesley, I think you can do that just using Mezzanine's built in multi 
> site handling.  Here are the docs on that, 
> https://mezzanine.jupo.org/docs/multi-tenancy.html
>
> On Thu, Sep 18, 2014 at 10:27 PM, Wesley > 
> wrote:
>
>> Hi guys,
>>These days I am trying to use Cartridge, and it's indeed a very good 
>> project.
>> Today one flash comes to be that is it easy to extend Cartridge to be a 
>> shop platform?
>>
>> I mean, currently, a Mezzanine site with Cartridge installed, work as a 
>> single shop, e.g. login with admin user, add product .etc.
>>
>> So, assume we setup a new website, there are two Companies, A and B, now 
>> A can login the site and add their products, 
>>
>> in the meantime, B should also login and add B's products and cannot view 
>> A's products.
>>
>> So, is it easy to do this or any existing apps? 
>>
>> Thanks.
>> Wesley
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Mezzanine Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to mezzanine-use...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Extend Cartridge to be a shop platform

2014-09-22 Thread Wesley
Thanks for your response.
I will dig into it when coding for that functionality.

Thanks.
Wesley

在 2014年9月22日星期一UTC+8下午7时35分43秒,Kenneth Bolton写道:
>
> I have done exactly what you are looking for using stock 
> Mezzanine/Cartridge. Do not over-think the problem. Use Mezzanine's 
> multi-tenancy and Django's groups and you have what you need.
>
> ken
>
> On Sun, Sep 21, 2014 at 11:40 PM, Wesley > 
> wrote:
>
>> Hi Josh,
>>Thanks for your reply.
>> I look at the multi-tenancy part.
>> I think it's not what I wanted.
>>
>> multi-tenancy is used for serving multiple sites within one project 
>> instance. And key point is upon host matching.
>> And, this suits to different hostnames, for example, two hostnames, 
>> example1.com and example2.com,  User1 access example1.com and user2 
>> access example2.com
>> This is OK when accessing different sites.
>>
>> My requirement is quite different users login the same site(domain name), 
>> so, this is different from the above scenario, I think I need to design 
>> different organizations with their admin can login to add their products 
>> and their own related staff.
>> I don't know if anyone has developed this or any existing apps there.
>>
>> Thanks.
>> Wesley
>>
>>
>> Hey Wesley, I think you can do that just using Mezzanine's built in multi 
>>> site handling.  Here are the docs on that, https://mezzanine.jupo.org/
>>> docs/multi-tenancy.html
>>>
>>> On Thu, Sep 18, 2014 at 10:27 PM, Wesley  wrote:
>>>
>>>> Hi guys,
>>>>These days I am trying to use Cartridge, and it's indeed a very good 
>>>> project.
>>>> Today one flash comes to be that is it easy to extend Cartridge to be a 
>>>> shop platform?
>>>>
>>>> I mean, currently, a Mezzanine site with Cartridge installed, work as a 
>>>> single shop, e.g. login with admin user, add product .etc.
>>>>
>>>> So, assume we setup a new website, there are two Companies, A and B, 
>>>> now A can login the site and add their products, 
>>>>
>>>> in the meantime, B should also login and add B's products and cannot 
>>>> view A's products.
>>>>
>>>> So, is it easy to do this or any existing apps? 
>>>>
>>>> Thanks.
>>>> Wesley
>>>>
>>>> -- 
>>>> You received this message because you are subscribed to the Google 
>>>> Groups "Mezzanine Users" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>> an email to mezzanine-use...@googlegroups.com.
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Mezzanine Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to mezzanine-use...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Extend Cartridge to be a shop platform

2014-09-22 Thread Wesley
Thanks for your response.
I will dig into it when coding for that functionality.

Thanks.
Wesley

在 2014年9月22日星期一UTC+8下午7时35分43秒,Kenneth Bolton写道:
>
> I have done exactly what you are looking for using stock 
> Mezzanine/Cartridge. Do not over-think the problem. Use Mezzanine's 
> multi-tenancy and Django's groups and you have what you need.
>
> ken
>
> On Sun, Sep 21, 2014 at 11:40 PM, Wesley > 
> wrote:
>
>> Hi Josh,
>>Thanks for your reply.
>> I look at the multi-tenancy part.
>> I think it's not what I wanted.
>>
>> multi-tenancy is used for serving multiple sites within one project 
>> instance. And key point is upon host matching.
>> And, this suits to different hostnames, for example, two hostnames, 
>> example1.com and example2.com,  User1 access example1.com and user2 
>> access example2.com
>> This is OK when accessing different sites.
>>
>> My requirement is quite different users login the same site(domain name), 
>> so, this is different from the above scenario, I think I need to design 
>> different organizations with their admin can login to add their products 
>> and their own related staff.
>> I don't know if anyone has developed this or any existing apps there.
>>
>> Thanks.
>> Wesley
>>
>>
>> Hey Wesley, I think you can do that just using Mezzanine's built in multi 
>>> site handling.  Here are the docs on that, https://mezzanine.jupo.org/
>>> docs/multi-tenancy.html
>>>
>>> On Thu, Sep 18, 2014 at 10:27 PM, Wesley  wrote:
>>>
>>>> Hi guys,
>>>>These days I am trying to use Cartridge, and it's indeed a very good 
>>>> project.
>>>> Today one flash comes to be that is it easy to extend Cartridge to be a 
>>>> shop platform?
>>>>
>>>> I mean, currently, a Mezzanine site with Cartridge installed, work as a 
>>>> single shop, e.g. login with admin user, add product .etc.
>>>>
>>>> So, assume we setup a new website, there are two Companies, A and B, 
>>>> now A can login the site and add their products, 
>>>>
>>>> in the meantime, B should also login and add B's products and cannot 
>>>> view A's products.
>>>>
>>>> So, is it easy to do this or any existing apps? 
>>>>
>>>> Thanks.
>>>> Wesley
>>>>
>>>> -- 
>>>> You received this message because you are subscribed to the Google 
>>>> Groups "Mezzanine Users" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>> an email to mezzanine-use...@googlegroups.com.
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Mezzanine Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to mezzanine-use...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] Customize product category theme

2014-09-23 Thread Wesley
Hi guys,
   I have one question that how to easily customize Cartridge product 
category format, with least change to Cartridge code.

Currently I see that the product category is arranged horizontal on top of 
each product page, and when click on the category, it enters to the page 
with all the sub-categories listed again on top of page, so, how to change 
the style? 

For example, if I wanna put the categories on the left of page, and when 
click on, it just pops up on the right side of cursor displaying all 
sub-categories, and only fresh the main frame when click the leaf category.

I know I could do this by customizing some related templates by adding 
css/js, but I don't want to change Cartridge more, is there any easy way to 
do this? 

Thanks.
Wesley

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Customize product category theme

2014-09-23 Thread Wesley
Hi all,
   Thanks for your reply.
I will use html/css/js to do this.

Wesley

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] Display differently according to user agent

2014-09-28 Thread Wesley
Hi guys,
   I have a question about displaying pages according to user agent.
Currently I wanna display menus only when requests from PC browser, i.e. 
when receive request from cell phone browser,hide the page menus.

1. I set the following in settings.py 
DEVICE_USER_AGENTS = (
("mobile", ("Android", "BlackBerry", "iPhone")),
("desktop", ("Windows", "Macintosh", "Linux")),
)
DEVICE_DEFAULT = "desktop"

2. I add mytheme(my own app used to customize 
mezzanine)/templates/mobile/base.html, and write some simple words in 
base.html.

Then, run server again, access from PC chrome, it's OK as usual.
But access from my nexus chrome, pages are some as previous.
This is user agent I print:
* PC chrome is Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 
(KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36
* Nexus phone chrome is Mozilla/5.0 (Linux; Android 4.4.4; Nexus 4 
Build/KTU84P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.99 
Mobile Safari/537.36

So, seems mezzanine didn't prefix template path with mobile, is there 
anything else I should configure or do?

Thanks.
Wesley

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Display differently according to user agent

2014-09-28 Thread Wesley
Hi Stephen,
   Do you mean remove the whole DEVICE_USER_AGENTS?
Then that will act just as usual, how to trigger action as I wanted?

Thanks.
Wesley



> On Sun, Sep 28, 2014 at 7:48 PM, Wesley > 
> wrote:
>
>> Hi guys,
>>I have a question about displaying pages according to user agent.
>> Currently I wanna display menus only when requests from PC browser, i.e. 
>> when receive request from cell phone browser,hide the page menus.
>>
>> 1. I set the following in settings.py 
>> DEVICE_USER_AGENTS = (
>> ("mobile", ("Android", "BlackBerry", "iPhone")),
>> ("desktop", ("Windows", "Macintosh", "Linux")),
>> )
>> DEVICE_DEFAULT = "desktop"
>>
>> 2. I add mytheme(my own app used to customize 
>> mezzanine)/templates/mobile/base.html, and write some simple words in 
>> base.html.
>>
>> Then, run server again, access from PC chrome, it's OK as usual.
>> But access from my nexus chrome, pages are some as previous.
>> This is user agent I print:
>> * PC chrome is Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 
>> (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36
>> * Nexus phone chrome is Mozilla/5.0 (Linux; Android 4.4.4; Nexus 4 
>> Build/KTU84P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.99 
>> Mobile Safari/537.36
>>
>> So, seems mezzanine didn't prefix template path with mobile, is there 
>> anything else I should configure or do?
>>
>> Thanks.
>> Wesley
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Mezzanine Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to mezzanine-use...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
> Your phone's user agent also says it's Linux which might cause the 
> behaviour.
>
> Try removing those settings you defined, the default for DEVICE_USER_AGENTS 
> already contains a much more comprehensive list of mobile user agents, and 
> doesn't define any for the desktop, since it's the default already.
>
>
> -- 
> Stephen McDonald
> http://jupo.org 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Display differently according to user agent

2014-09-28 Thread Wesley
Hi Kenneth,
  Thanks for your suggestion. I will look at the link you gave for details.
BTW, why I wanna customize is I got some special requirements from customer.
Anyway, I will follow your suggestion that don't break those existing 
behavior in Mezzanine unless I am sure it's an improvement.

Thanks again.
Wesley


Hi Wesley,
>
> What Stephen is saying is that the default settings.DEVICE_USER_AGENTS 
> provides a better mapping than the one you hacked together. Take a look at 
> https://github.com/stephenmcd/mezzanine/blob/e2b0aa6d6fbf699f3e1c68a4a522f5abaf40bbb6/mezzanine/core/defaults.py#L116-L136
>  
> to see how Mezzanine behaves out-of-the-box. Putting your own 
> tuple-of-tuples in there is begging for breakage.
>
> Looking back at the history of your posts to this list, I notice lots of 
> attempts by you to go your own way. While you may get to your destination, 
> you are spending a lot of energy fighting the sane defaults and well-tested 
> functionality of Mezzanine. It appears, to this reader, that you think your 
> cases are special and require lots of customizing. Twenty years in this 
> business has taught me that there are very few special cases and almost all 
> of those should be put on the back burner and re-considered when time 
> allows. Take some time to internalize the Zen of Python 
> <http://legacy.python.org/dev/peps/pep-0020/>. Resist the temptation to 
> make changes until you can prove that the change will be an improvement.
>
> hth,
> ken
>
> On Sun, Sep 28, 2014 at 6:40 AM, Wesley > 
> wrote:
>
>> Hi Stephen,
>>Do you mean remove the whole DEVICE_USER_AGENTS?
>> Then that will act just as usual, how to trigger action as I wanted?
>>
>> Thanks.
>> Wesley
>>
>>
>>
>>> On Sun, Sep 28, 2014 at 7:48 PM, Wesley  wrote:
>>>
>>>> Hi guys,
>>>>I have a question about displaying pages according to user agent.
>>>> Currently I wanna display menus only when requests from PC browser, 
>>>> i.e. when receive request from cell phone browser,hide the page menus.
>>>>
>>>> 1. I set the following in settings.py 
>>>> DEVICE_USER_AGENTS = (
>>>> ("mobile", ("Android", "BlackBerry", "iPhone")),
>>>> ("desktop", ("Windows", "Macintosh", "Linux")),
>>>> )
>>>> DEVICE_DEFAULT = "desktop"
>>>>
>>>> 2. I add mytheme(my own app used to customize 
>>>> mezzanine)/templates/mobile/base.html, and write some simple words in 
>>>> base.html.
>>>>
>>>> Then, run server again, access from PC chrome, it's OK as usual.
>>>> But access from my nexus chrome, pages are some as previous.
>>>> This is user agent I print:
>>>> * PC chrome is Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 
>>>> (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36
>>>> * Nexus phone chrome is Mozilla/5.0 (Linux; Android 4.4.4; Nexus 4 
>>>> Build/KTU84P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.99 
>>>> Mobile Safari/537.36
>>>>
>>>> So, seems mezzanine didn't prefix template path with mobile, is there 
>>>> anything else I should configure or do?
>>>>
>>>> Thanks.
>>>> Wesley
>>>>
>>>> -- 
>>>> You received this message because you are subscribed to the Google 
>>>> Groups "Mezzanine Users" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>> an email to mezzanine-use...@googlegroups.com.
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>> Your phone's user agent also says it's Linux which might cause the 
>>> behaviour.
>>>
>>> Try removing those settings you defined, the default for DEVICE_USER_AGENTS 
>>> already contains a much more comprehensive list of mobile user agents, and 
>>> doesn't define any for the desktop, since it's the default already.
>>>
>>>
>>> -- 
>>> Stephen McDonald
>>> http://jupo.org 
>>>
>>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Mezzanine Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to mezzanine-use...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] Add one DateTimeField to Order model and display as a popup calendar in rendered template

2014-10-09 Thread Wesley
Hi all,
   I hava a question regarding customize Order model.
Now I wanna add a DateTimeField to Order model, and according to "MODEL 
CUSTOMIZATION" part from Mezzanine doc center,
I have succeeded to add the field(named as prefer_time),and it's OK to 
display this field in admin too.

Now, what I want is making it's widget just like what in the admin, i.e. 
display the field as a calendar,thus user can click and select specified 
datetime.

So, I don't wanna change Cartridge source but I just have a try first here.
within __init__ function of OrderForm of shop/form.py, I add this line:
self.fields['prefer_time'].widget = forms.DateTimeInput()

Then I start the server,and refresh page, the DateTimeField prefer_time 
still is a text input.
So, what's more should I do to dispaly this field as a popup calendar 
widget here?

Thanks.
Wesley

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] Does Cartridge has customer center?

2014-10-12 Thread Wesley
Hi guys,
  I setup a shop based on Mezzanine and Cartridge.
Is there any existing page like customer center, I mean, here customer who 
is buying anything from the shop can maintain his/her our profile,
for example, change password, email address, and also can see his/her own 
order history.

I see I can develop such interface, just wanna if there is existing one 
integrated to Mezzanine/Cartridge.

Thanks.
Wesley

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Does Cartridge has customer center?

2014-10-13 Thread Wesley
Hi Stephen,
   Thanks for your reply.,
I got the place.

Wesley

在 2014年10月13日星期一UTC+8上午3时29分48秒,Stephen McDonald写道:
>
> Mezzanine has public user accounts with profiles via the 
> "mezzanine.accounts" app: 
>
> http://mezzanine.jupo.org/docs/user-accounts.html
>
> Cartridge extends it with the ability to view your past orders.
>
> On Mon, Oct 13, 2014 at 1:03 AM, Wesley > 
> wrote:
>
>> Hi guys,
>>   I setup a shop based on Mezzanine and Cartridge.
>> Is there any existing page like customer center, I mean, here customer 
>> who is buying anything from the shop can maintain his/her our profile,
>> for example, change password, email address, and also can see his/her own 
>> order history.
>>
>> I see I can develop such interface, just wanna if there is existing one 
>> integrated to Mezzanine/Cartridge.
>>
>> Thanks.
>> Wesley
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Mezzanine Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to mezzanine-use...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Stephen McDonald
> http://jupo.org 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] Captcha validator error with Cartridge checkout steps

2014-10-21 Thread Wesley
Hi all,
  I hit a problem when setup site upon Cartridge.
Currently I wanna generate captcha during checkout steps.
So,after a while's google work, I find 
https://github.com/mjtorn/mezzanine-captcha.
Follow the installation, I setup the test env, and, add captcha field to 
OrderForm like
wni_captcha = captcha.fields.CaptchaField()

Then, run the server, everything is OK and captcha image displays correctly.

However, when I enter the right characters, the form always raises captcha 
validator error:-(

Anyone hit before?
Or any better way to make captcha?

Thanks.
Wesley

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] Re: Captcha validator error with Cartridge checkout steps

2014-10-22 Thread Wesley
Seems django simple captcha has problem with form wizard which is used for 
OrderForm, right?
Here is issue link: https://github.com/mbi/django-simple-captcha/issues/6

So, anyone has suggestion to fix this? or better idea to make captcha when 
checking out?

Thanks.
Wesley

在 2014年10月21日星期二UTC+8下午8时32分25秒,Wesley写道:
>
> Hi all,
>   I hit a problem when setup site upon Cartridge.
> Currently I wanna generate captcha during checkout steps.
> So,after a while's google work, I find 
> https://github.com/mjtorn/mezzanine-captcha.
> Follow the installation, I setup the test env, and, add captcha field to 
> OrderForm like
> wni_captcha = captcha.fields.CaptchaField()
>
> Then, run the server, everything is OK and captcha image displays 
> correctly.
>
> However, when I enter the right characters, the form always raises captcha 
> validator error:-(
>
> Anyone hit before?
> Or any better way to make captcha?
>
> Thanks.
> Wesley
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] Re: Captcha validator error with Cartridge checkout steps

2014-10-22 Thread Wesley
Seems django simple captcha has problem with form wizard which is used for 
OrderForm, right?
Here is issue link: https://github.com/mbi/django-simple-captcha/issues/6

So, anyone has suggestion to fix this? or better idea to make captcha when 
checking out?

Thanks.
Wesley

在 2014年10月21日星期二UTC+8下午8时32分25秒,Wesley写道:
>
> Hi all,
>   I hit a problem when setup site upon Cartridge.
> Currently I wanna generate captcha during checkout steps.
> So,after a while's google work, I find 
> https://github.com/mjtorn/mezzanine-captcha.
> Follow the installation, I setup the test env, and, add captcha field to 
> OrderForm like
> wni_captcha = captcha.fields.CaptchaField()
>
> Then, run the server, everything is OK and captcha image displays 
> correctly.
>
> However, when I enter the right characters, the form always raises captcha 
> validator error:-(
>
> Anyone hit before?
> Or any better way to make captcha?
>
> Thanks.
> Wesley
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] Easy way to extends Form fields?

2014-10-26 Thread Wesley
Hi all,
   I see there is a settings option named EXTRA_MODEL_FIELDS to add field 
to one Model.
Is there one used for Form instead of Model? 

Thanks.
Wesley

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Easy way to extends Form fields?

2014-10-27 Thread Wesley
Hi Josh,
   Actually, I wanna add a captcha validator on the sign in form, that is 
mezzanine.accounts.forms.LoginForm.
I use django-simple-captcha plugin, so I need a add a field to the 
LoginForm, but I don't wanna change mezzanine code.
So, I see EXTRA_MODEL_FIELDS is easily used to add fileds to existing 
Model, what about for existing Form?
I see LoginForm is not inherited from ModelForm, otherwise, I can add field 
to the Model.

Thanks.
Wesley

Hey Wesley, not that I'm aware of.  What are you trying to do?
>
> On Sun, Oct 26, 2014 at 11:08 PM, Wesley > 
> wrote:
>
>> Hi all,
>>I see there is a settings option named EXTRA_MODEL_FIELDS to add 
>> field to one Model.
>> Is there one used for Form instead of Model? 
>>
>> Thanks.
>> Wesley
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Mezzanine Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to mezzanine-use...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] Use EXTRA_MODEL_FIELDS to add ManyToManyField

2014-11-03 Thread Wesley
Hi guys,
  I hit a problem when add ManyToManyField via EXTRA_MODEL_FIELDS.
I wanna add relation between DiscountCode and User Model like this:

from django.contrib.auth.models import User
EXTRA_MODEL_FIELDS = (
(
"cartridge.shop.models.DiscountCode.rel_users",
"ManyToManyField",
(User,),
{"blank": True, "null": True,'verbose_name':"valid 
users",'related_name':'discountcodes'},
),
  )
  
I got this:
D:\workspace43\weichun>python manage.py runserver
Traceback (most recent call last):
  File "manage.py", line 11, in 
from settings import PROJECT_ROOT, PROJECT_DIRNAME
  File "D:\workspace43\weichun\settings.py", line 362, in 
from local_settings import *
  File "D:\workspace43\weichun\local_settings.py", line 53, in 
from django.contrib.auth.models import User
  File "D:\Python27\lib\site-packages\django\contrib\auth\models.py", line 
8, in 
from django.db import models
  File "D:\Python27\lib\site-packages\django\db\__init__.py", line 11, in 

if settings.DATABASES and DEFAULT_DB_ALIAS not in settings.DATABASES:
  File "D:\Python27\lib\site-packages\django\conf\__init__.py", line 52, in 
__getattr__
self._setup(name)
  File "D:\Python27\lib\site-packages\django\conf\__init__.py", line 45, in 
_setup
% (desc, ENVIRONMENT_VARIABLE))
django.core.exceptions.ImproperlyConfigured: Requested setting DATABASES, 
but settings are not configured. You must either define the environment 
variable DJANGO_SETTINGS_MODULE or call settings.confi
gure() before accessing settings.

So how to fix this? Does EXTRA_MODEL_FIELDS support adding ManyToManyField?

Thanks.
Wesley

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] Error happened when customizing account profile

2014-11-03 Thread Wesley
Hi all,
   I hit a problem when custom account profile.
So, actually, I just wanna add birthday and gender(both required) to user 
profile, showing the two guys in signup and change form.

Look at the mezzanine doc center, I find AUTH_PROFILE_MODULE.

Here is my profile model:
GENDER_CHOICES = (
('M', 'Man'),
('F', 'Woman'),
)

class UserProfile(models.Model):
# This field is required.
user = models.OneToOneField(User)

# Other fields here
date_of_birth = models.DateTimeField()
gender = models.CharField(max_length=1, choices=GENDER_CHOICES)

and, set AUTH_PROFILE_MODULE = "mytheme.UserProfile"

So,here is problems:
1. when adding user from admin site, it says user is successfully added, 
but actually it's not.
2. signup page, alway say that column date_of_birth cannot be null, but 
acctually it's has value seen from debug tool.
   What's more,  althouth it raises error here, but the user is added in 
the backend database.

So, seems signup form doesn't check new added date_of_birth and gender when 
doing user.save()?

Any easy way to do what I want?

Thanks.
Wesley

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] Cutomize update cart behavior

2014-11-05 Thread Wesley
Hi guys,
   I have a question related to customizing update cart feature.

Currently, on the cart page, it displays all items, one update cart button 
and check out button.
And, if I wanna change quantity of some item or delete one item, I have to 
press update cart button.

Currently, what I want is:
1. remove update cart button
2. real-time update the cart items, for example, if I wanna delete one 
item, the item disappears after i check delete box,and if I change item 
quantity,
it should take effect when I directly press checkout button.

So, do you have some suggestions to achieve this in any easy way?

Thanks.
Wesley

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] Cartridge add-to-cart feature?

2014-11-09 Thread Wesley
Hi guys,
   Does Cartridge has add-to-cart feature already?

I just find that in product detail page, we only have "buy" button to cart 
page.
Do we have something like 'add to cart' functionality? 
Thus we can add products to cart first and see cart for details later, if 
we don't have such feature, if we wanna buy two products, we have to:
1. enter product 1 detail page, press 'buy' button to enter cart page.
2. return back to shop list page, choose another product, enter into detail 
page , press 'buy' again...

I think it's not tidy way for users to choose multiple products.
Any suggestions?

Thanks.
Wesley

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] Control product visibility by Time instead of DateTime

2014-11-29 Thread Wesley
Hi guys,
  I have a question regarding Product's valid_from and valid_to field.
Currently, I see we can control product's visibility by setting its 
valid_from and valid_to field.

I see they are DateTime filed, i.e. I have to set both date and time part, 
and, product shows all the time through the given datetime period.

However, currently, I have a requirement that set the visibility by Time, 
instead of DateTime,
I mean, show the product through a specified time period every day, for 
example, display the product 08:00 - 16:00 every day.

Is there anyway to achieve this without changing Mezzanine/Cartridge source 
code?

Thanks.
Wesley

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Control product visibility by Time instead of DateTime

2014-12-01 Thread Wesley
Hi Josh,
  Thanks for your reply.

I think DiscountCodeManager's active() method can only control visible of 
DiscountCode model, right?
Currently, I wanna control behavior of Product and Category.

Lucky that what you said gives me a good direction to dig into the code.
So, I see that Category/Product inherit from Displayable Model where are 
publish_date and expiry_date come from.
And, Category/Product's objects are both related to PublishedManager which 
has a published() method.

So, I think:
1. inject one Time field to Displayable model
2. custom published() method to check the new added Time field.

I don't know If this is correct but I will have a try later.

Thanks.
Wesley


Hey Wesley, what I would do is use field injection to add the time fields 
> to Product and then monkey patch active method of the DiscountManager (
> https://github.com/stephenmcd/cartridge/blob/master/cartridge/shop/managers.py#L212)
>  
> to also check the current time against the newly injected time fields.
>
> On Sun, Nov 30, 2014 at 1:08 AM, Wesley > 
> wrote:
>
>> Hi guys,
>>   I have a question regarding Product's valid_from and valid_to field.
>> Currently, I see we can control product's visibility by setting its 
>> valid_from and valid_to field.
>>
>> I see they are DateTime filed, i.e. I have to set both date and time 
>> part, and, product shows all the time through the given datetime period.
>>
>> However, currently, I have a requirement that set the visibility by Time, 
>> instead of DateTime,
>> I mean, show the product through a specified time period every day, for 
>> example, display the product 08:00 - 16:00 every day.
>>
>> Is there anyway to achieve this without changing Mezzanine/Cartridge 
>> source code?
>>
>> Thanks.
>> Wesley
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Mezzanine Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to mezzanine-use...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] 'Cursor' object has no attribute '_last_executed'

2014-12-15 Thread Wesley
Hi all,
   I hit a problem when deploy my Cartridge app.

My setup env:
nginx : 1.6
uwsgi : 2.0.7
Django==1.5

Mezzanine==3.1.9
MySQL-python==1.2.3

Mysql is 5.6.16


So, everything works fine except that when finally checkout I got:

AttributeError at /shop/checkout/

'Cursor' object has no attribute '_last_executed'


Anybody hit this before?


Thanks.

Wesley

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] HTML element's style is removed when save page.

2015-01-07 Thread Wesley
Hi,
   I find a problem today that, I create a page and edit the html source( 
in admin, it's tiny_mce) by adding style to some elements, e.g. 
style="width:100%;" .etc.

It's good displayed within tiny_mce plugin, however, when I press save to 
save the page, page is saved successfully, but style attribute is removed...

Any one hit this before?

Thanks.
Wesley

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] Set discount according to given rules

2015-02-02 Thread Wesley
Hi guys,
  I wanna consult with you about setting discount by given rules.
For example, for specified products, unit price is 10, if you buy two, we 
set total to 18 instead of 20, and for quantity 3, set total to 25, .etc

So, could you guys give me a direction to do this?
My first thought is to filter items in an order and do according evaluation 
one by one, but I am afraid this would lead to performance issue.

And suggestions?

Thanks.
Wesley

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] Re: Cartridge. Change price by quantity (discount)

2015-02-02 Thread Wesley
Hi ,
  I am facing the same issue.
Any final solution yet?

Thanks.
Wesley

It's just a discussion post. I will extend Cartridge to make one feature. 
> Change product price item by change quantity of this product. Something 
> like this, for example:
>
> +--+-++
> | Quantity | Total Price | Price per item |
> +--+-++
> |1 | $100| $100   |
> |2 | $196| $98|
> |3 | $282| $94|
> |4 | $360| $90|
> |5 | $425| $85|
> +--+-++
>
> I haven't more experience of extending Cartridge and want to get some 
> advice about it. I take a look at models and can't decide which model i 
> should extend. "Priced" with extended Priced.price logic (with extended 
> Discount and Sale model implemented price by table like above) or something 
> another? I have one's doubts about simple implementation of this way, 
> because estimate some implicit relations of Cartridge models.
>
> If anybody have ideas or advices please reply. And thanks in advance for 
> it :)
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] Re: Cartrige custom shipping by country and product category

2015-02-02 Thread Wesley
Hi ,
 I have one question.
Assume you've finished this feature.

So, when one order comes, containing multiple products, so, how to set the 
final shipping value?

Filter all items and set to the most expensive one?

Thanks.
Wesley

Hey everyone,
>
> After browsing on the forum, I successfully setup a custom billship_hander 
> depending on the country from the order_form
>
> SHOP_HANDLER_BILLING_SHIPPING = "myapp.checkout.custom_billship_handler"
>
> def custom_billship_handler(request, order_form):
>
> if order_form is not None:
> if not request.session.get("free_shipping"):
> settings.use_editable()
>
>
> if order_form.cleaned_data["shipping_detail_country"] == 
> "Canada":
> set_shipping(request, "CanadaPost Regular", 5.00)
>
>
> elif order_form.cleaned_data["shipping_detail_country"] == 
> "US":
> set_shipping(request, "CanadaPost US Regular", 7.90)
>
>
> else:
> set_shipping(request, _("Flat rate shipping"), settings.
> SHOP_DEFAULT_SHIPPING_VALUE)
>
>
>
> But now, is there a way to filter my shipping by location + category, or 
> product type as defined in my child_categories ?
>
> I've been trying with the cart and order instance, but it doesn't work:
>
> #cart = Cart.objects.from_request(request)
> #cart_test = request.cart.has_items()
> #order = Order.objects.from_request(request)
>
> Any tips is appreciated! Thanks 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Re: Cartrige custom shipping by country and product category

2015-02-04 Thread Wesley
Hi Josh,
  Thanks for your reply.
Got that and I will try later on,

Wesley

You should be able to do that in the billship handler.  You can see the 
> default here,
>
> https://bitbucket.org/stephenmcd/cartridge/src/57a56a41baf1b70789567a1d06b79a473e719a22/cartridge/shop/checkout.py?at=default#cl-26
>
> The important part is that it points out that you can access request.cart
>
> So in your handler you would want to do something like:
>
> for item in request.cart:
> # if this is the max price so far store it
> # else continue
>
> # set the shipping to the max price
>
> On Tue, Feb 3, 2015 at 1:43 AM, Wesley > 
> wrote:
>
>> Hi ,
>>  I have one question.
>> Assume you've finished this feature.
>>
>> So, when one order comes, containing multiple products, so, how to set 
>> the final shipping value?
>>
>> Filter all items and set to the most expensive one?
>>
>> Thanks.
>> Wesley
>>
>>
>> Hey everyone,
>>>
>>> After browsing on the forum, I successfully setup a custom 
>>> billship_hander depending on the country from the order_form
>>>
>>> SHOP_HANDLER_BILLING_SHIPPING = "myapp.checkout.custom_billship_handler"
>>>
>>> def custom_billship_handler(request, order_form):
>>>
>>> if order_form is not None:
>>> if not request.session.get("free_shipping"):
>>> settings.use_editable()
>>>
>>>
>>> if order_form.cleaned_data["shipping_detail_country"] == 
>>> "Canada":
>>> set_shipping(request, "CanadaPost Regular", 5.00)
>>>
>>>
>>> elif order_form.cleaned_data["shipping_detail_country"] == 
>>> "US":
>>> set_shipping(request, "CanadaPost US Regular", 7.90)
>>>
>>>
>>> else:
>>> set_shipping(request, _("Flat rate shipping"), settings.
>>> SHOP_DEFAULT_SHIPPING_VALUE)
>>>
>>>
>>>
>>> But now, is there a way to filter my shipping by location + category, or 
>>> product type as defined in my child_categories ?
>>>
>>> I've been trying with the cart and order instance, but it doesn't work:
>>>
>>> #cart = Cart.objects.from_request(request)
>>> #cart_test = request.cart.has_items()
>>> #order = Order.objects.from_request(request)
>>>
>>> Any tips is appreciated! Thanks 
>>>
>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Mezzanine Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to mezzanine-use...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] How to hide product unavailable for purchase on the web page?

2015-02-04 Thread Wesley
Hi guys,
  I have a question that,how to hide product with unavailable for purchase 
on the page?

I see that, it's showing on the page, but only says no in stock when click 
into the detail product page.

So, how to directly make it hidden from product list on the page?

I tried to select "draft" or even make it out-of-date, but get the same 
behavior.

Any suggestion?

Thanks.
Wesley

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] How to hide product unavailable for purchase on the web page?

2015-02-09 Thread Wesley
Hi Danny,
  I just realized this, but thanks to you all the same.

Sorry for the noise.

Thanks.
Wesley


On 5/02/2015 4:27 PM, Wesley wrote: 
> > Hi guys, 
> >I have a question that,how to hide product with unavailable for 
> > purchase on the page? 
> > 
> > I see that, it's showing on the page, but only says no in stock when 
> > click into the detail product page. 
> > 
> > So, how to directly make it hidden from product list on the page? 
> > 
> > I tried to select "draft" or even make it out-of-date, but get the same 
> > behavior. 
> > 
>
> Draft is the way to go - only admin users will see it then. 
>
> Log out of your account (or view your site in a different browser) and 
> you'll notice that the product isn't listed. 
>
> Seeya. Danny. 
>
>
> -- 
> Email: mol...@gmail.com  
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] Cartridge payment

2015-02-10 Thread Wesley
Hi guys,
   I have a question about payment.
Currently, I see that, during payment process, user only enter card 
number/name .etc that are required on the page.

So, is it easy to interact with some other payment system, e.g. directly 
with back system or something like Paypal .etc

Thanks.
Wesley

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] Cartridge: New field to OrderForm with multiwidge, value is always None in comfirmation.html

2015-03-23 Thread Wesley
Hi guys, 
  I hit a problem when customize OrderForm.
I wanna add an option for user choosing to pickup the package, 
1.we send the package to office
2.they come to retrieve
If 2 is chosen, we display our sites for their choice again.

So, I wanna use multiwidget to do this.

Below is code snippet:
0. add model field using EXTRA_MODEL_FIELDS
(
"cartridge.shop.models.Order.delivery_type",
'CharField',#"DateTimeField",
{"default":u'efoodin',"max_length":60},
),

1.widget and field customize
class WniChoiceWidget(forms.MultiWidget):
def decompress(self,value):
if value:
#hard code here just for test
return [u'buyer',u'rj']
return ['buyer',u'xz']

class WniComplexChoiceField(forms.MultiValueField):
def __init__(self, wnichoices, max_length=80, *args, **kwargs):
""" sets the two fields as not required but will enforce that (at 
least) one is set in compress """
fields = 
(forms.ChoiceField(widget=forms.RadioSelect,choices=(('efoodin',u'efoodin 
delivery'),('buyer',u'self retrieve')),required=False),
  forms.ChoiceField(choices=wnichoices,required=False))
self.widget = WniChoiceWidget(widgets=[f.widget for f in fields])

super(WniComplexChoiceField,self).__init__(required=False,fields=fields,*args,**kwargs)
def compress(self,data_list):
""" return the choicefield value if selected or charfield value (if 
both empty, will throw exception """
if not data_list:
raise ValidationError('Need to select choice or enter text for 
this field')
#print data_list
return data_list[0] if data_list[0].startswith('efoodin') else 
data_list[1]

2. Within OrderForm, add this guy
delivery_type=WniComplexChoiceField(wnichoices=settings.CENTER_POTS['Tx'])

3. And, here is snippet in comformation.html
{% for field in form %}{% ifequal field.name "delivery_type" 
%}delivery_type:  {{ field.value }}{% 
endifequal %}{{ field }}{% endfor %}

And, problem is:
1. to billing_shipping page, everything filled, and then, click "next" to 
comfirmation page.
2. problem goes here, delivery_type is None...
3. on the current wrong comfirmation page, click to edit shopping cart
4. return to checkout
5. Interesting, delivery_type is back and with correct value.

So, what's going on with this?
Is something related to formset? I see OrderForm is a formset.

Thanks.
Wesley

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] Is it security without sign in required during checkout process?

2015-03-30 Thread Wesley
Hi all,
   I just have a question here regarding SHOP_CHECKOUT_ACCOUNT_REQUIRED.
I see that this guy defaults to False, thus, customer can finish one 
checkout process without signup/sign in.

Actually, many customers like this style, and I tried to set this setting 
to True, then, many customers said it's complex because they need to 
signup(if they don't have one account yet) and sign in to continue the 
checkout process, what they want is just fill in the shipping details and 
next to place the order.

So, I turned it off again, but, I am concern the security here.
If we can make an order without sign in, how to avoid those fake orders, 
maybe somebody comes by, and random click but make an order...
And, what's more, is this easy to attacked by something like DDOS, I mean, 
for example, write a robot to keep sending orders since we don't need 
login(we can place captcha here).

So, do you guys have any suggestions here if I set this setting to False? 
Any code here to ensure the security or through any nginx settings?

Thanks.
Wesley

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] Nothing displayed on page when CheckoutError raised during checkout

2015-04-01 Thread Wesley
Hi guys,
I hit a situation today when I have a try to customize 
shop_handler_payment.

My customized payment handler do nothing but just raise 
cartridge.shop.checkout.CheckoutError exception.

But, one confirmation page, when I click next button, nothing displayed on 
page indicating that this is error during checkout process, page just 
refresh and stay in confirmation page again.

Is this just as designed? Or any special configurations for this behavior?

Thanks.
Wesley

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] Re: Nothing displayed on page when CheckoutError raised during checkout

2015-04-02 Thread Wesley
Hi Mathias,
Sure, I set this guy to my own handler which does nothing but raises 
CheckoutError directly.
And I find that If I raise Exception('whatever'), exception raised when 
click next on page.
I see in checkout_steps, it catches CheckoutError and I haven't changed the 
code.

Strange...

Thanks.
Wesley

Just to be sure and not miss something obvious: does your 
> settings.SHOP_HANDLER_PAYMENT points to your custom function?
>
>
>
> Le mercredi 1 avril 2015 10:52:56 UTC+2, Wesley a écrit :
>>
>> Hi guys,
>> I hit a situation today when I have a try to customize 
>> shop_handler_payment.
>>
>> My customized payment handler do nothing but just raise 
>> cartridge.shop.checkout.CheckoutError exception.
>>
>> But, one confirmation page, when I click next button, nothing displayed 
>> on page indicating that this is error during checkout process, page just 
>> refresh and stay in confirmation page again.
>>
>> Is this just as designed? Or any special configurations for this behavior?
>>
>> Thanks.
>> Wesley
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] How to get order final total price in views function?

2015-05-27 Thread Wesley
Hi guys,
   In one of my views function, I wanna get final total price of the order.

I tried to get from request.session['order']['total'] or 
request.session['cart']['something'] but all failed.

I print order and cart getting this sample:
order is:
{'card_name': u'', u'delivery_type': u'', 'remember': True, 'pay_type': 
u'\u5fae\u4fe1\u652f\u4ed8', 'billing_detail_street': u'\u6d4b\u8bd5', 
'shipping_detail_first_name': u'\u502a\u6770', 'shipping_detail_street': 
u'\u6d4b\u8bd5', u'additional_instructions': u'', 'card_type': u'', 'step': 
2, 'same_billing_shipping': True, u'prefer_time': 
u'\u7acb\u5373\u9001\u9910', 'shipping_detail_phone': u'11211', 
'billing_detail_email': u'whatever here', 'billing_detail_phone': u'11211', 
'billing_detail_first_name': u'\u502a\u6770'}

cart is:544

So, no something like 'total' in order object, and cart is id.

Maybe I can get price to query database according to the cart's id, but is 
there any easy way to get the total price?

Thanks.
Wesley

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] Re: How to get order final total price in views function?

2015-05-27 Thread Wesley
Sorry missing one that:
I am trying to get the price from checkout confirmation page, I mean, when 
click "Next" on the page.


Hi guys,
>In one of my views function, I wanna get final total price of the order.
>
> I tried to get from request.session['order']['total'] or 
> request.session['cart']['something'] but all failed.
>
> I print order and cart getting this sample:
> order is:
> {'card_name': u'', u'delivery_type': u'', 'remember': True, 'pay_type': 
> u'\u5fae\u4fe1\u652f\u4ed8', 'billing_detail_street': u'\u6d4b\u8bd5', 
> 'shipping_detail_first_name': u'\u502a\u6770', 'shipping_detail_street': 
> u'\u6d4b\u8bd5', u'additional_instructions': u'', 'card_type': u'', 'step': 
> 2, 'same_billing_shipping': True, u'prefer_time': 
> u'\u7acb\u5373\u9001\u9910', 'shipping_detail_phone': u'11211', 
> 'billing_detail_email': u'whatever here', 'billing_detail_phone': u'11211', 
> 'billing_detail_first_name': u'\u502a\u6770'}
>
> cart is:544
>
> So, no something like 'total' in order object, and cart is id.
>
> Maybe I can get price to query database according to the cart's id, but is 
> there any easy way to get the total price?
>
> Thanks.
> Wesley
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] Re: How to get order final total price in views function?

2015-05-27 Thread Wesley
Hi,
  I am trying to get this guy jus in a regular view.
My scenario is:
 Within checkout confirmation page, when click on 'next' to complete the 
order, raises a ajax request to a regular view to do something,and in this 
view function(only request available) I need ordr total.
But, currently in the confirmation page, order is not setup or saved, so no 
order object available now.

BTW, you mentioned, combine request.session["shipping_total"] and 
request.cart.total_price(), then, what about tax and discount, these two 
guys cover the latter two valuation?

Currently, I use the following snippet to get the total price(changed the 
source code, so it's not a good idea...), don't know if it's exactly 
correct but haven't hit any issue yet:
Model Order:
def get_tmp_total(self, request):
"""
added by wni.
for weixin pay, on confirm page, need to get total for weixin order 
creation.
"""
#self.key = request.session.session_key
#self.user_id = request.user.id
for field in self.session_fields:
if field in request.session:
setattr(self, field, request.session[field])
total = request.cart.total_price()
if self.shipping_total is not None:
total += Decimal(str(self.shipping_total))
if self.discount_total is not None:
total -= Decimal(self.discount_total)
if self.tax_total is not None:
total += Decimal(self.tax_total)
return total

In view function:
tmp_order = form.save(commit=False)
request.session['wni_wxpay_total'] = tmp_order.get_tmp_total(request)

Wesey

Hi,
>
> Where are you trying to get this value? Is it a step handler like 
> SHOP_HANDLER_PAYMENT or SHOP_HANDLER_ORDER? Or a regular view?
>
> If you have an order object then it should be available in order.total, 
> given that you are “far enought” in the checkout process so it has been 
> computed. If you just have a request, try request.session["shipping_total"] 
> combined with request.cart.total_price().
>
>
>
> Le mercredi 27 mai 2015 13:49:51 UTC+2, Wesley a écrit :
>>
>> Sorry missing one that:
>> I am trying to get the price from checkout confirmation page, I mean, 
>> when click "Next" on the page.
>>
>>
>> Hi guys,
>>>In one of my views function, I wanna get final total price of the 
>>> order.
>>>
>>> I tried to get from request.session['order']['total'] or 
>>> request.session['cart']['something'] but all failed.
>>>
>>> I print order and cart getting this sample:
>>> order is:
>>> {'card_name': u'', u'delivery_type': u'', 'remember': True, 'pay_type': 
>>> u'\u5fae\u4fe1\u652f\u4ed8', 'billing_detail_street': u'\u6d4b\u8bd5', 
>>> 'shipping_detail_first_name': u'\u502a\u6770', 'shipping_detail_street': 
>>> u'\u6d4b\u8bd5', u'additional_instructions': u'', 'card_type': u'', 'step': 
>>> 2, 'same_billing_shipping': True, u'prefer_time': 
>>> u'\u7acb\u5373\u9001\u9910', 'shipping_detail_phone': u'11211', 
>>> 'billing_detail_email': u'whatever here', 'billing_detail_phone': u'11211', 
>>> 'billing_detail_first_name': u'\u502a\u6770'}
>>>
>>> cart is:544
>>>
>>> So, no something like 'total' in order object, and cart is id.
>>>
>>> Maybe I can get price to query database according to the cart's id, but 
>>> is there any easy way to get the total price?
>>>
>>> Thanks.
>>> Wesley
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Re: How to get order final total price in views function?

2015-05-27 Thread Wesley
Hi Stephen,
   Thanks for your reply.
I haven't realized the _order_totals tag before.

Will have a look :-)

Wesley

You're kind of mimicking the _order_totals function which gets used in 
> template tags:
>
>
> https://github.com/stephenmcd/cartridge/blob/master/cartridge/shop/templatetags/shop_tags.py#L34
>
> You could probably do something like:
>
> from cartridge.shop.templatetags.shop_tags import _order_totals
> order_vars = _order_totals({"request": request})
> print order_vars["order_total"]
>
> On Wed, May 27, 2015 at 6:01 PM, Wesley > 
> wrote:
>
>> Hi,
>>   I am trying to get this guy jus in a regular view.
>> My scenario is:
>>  Within checkout confirmation page, when click on 'next' to complete the 
>> order, raises a ajax request to a regular view to do something,and in this 
>> view function(only request available) I need ordr total.
>> But, currently in the confirmation page, order is not setup or saved, so 
>> no order object available now.
>>
>> BTW, you mentioned, combine request.session["shipping_total"] and 
>> request.cart.total_price(), then, what about tax and discount, these two 
>> guys cover the latter two valuation?
>>
>> Currently, I use the following snippet to get the total price(changed the 
>> source code, so it's not a good idea...), don't know if it's exactly 
>> correct but haven't hit any issue yet:
>> Model Order:
>> def get_tmp_total(self, request):
>> """
>> added by wni.
>> for weixin pay, on confirm page, need to get total for weixin 
>> order creation.
>> """
>> #self.key = request.session.session_key
>> #self.user_id = request.user.id
>> for field in self.session_fields:
>> if field in request.session:
>> setattr(self, field, request.session[field])
>> total = request.cart.total_price()
>> if self.shipping_total is not None:
>> total += Decimal(str(self.shipping_total))
>> if self.discount_total is not None:
>> total -= Decimal(self.discount_total)
>> if self.tax_total is not None:
>> total += Decimal(self.tax_total)
>> return total
>>
>> In view function:
>> tmp_order = form.save(commit=False)
>> request.session['wni_wxpay_total'] = tmp_order.get_tmp_total(request)
>>
>> Wesey
>>
>> Hi,
>>>
>>> Where are you trying to get this value? Is it a step handler like 
>>> SHOP_HANDLER_PAYMENT or SHOP_HANDLER_ORDER? Or a regular view?
>>>
>>> If you have an order object then it should be available in order.total, 
>>> given that you are “far enought” in the checkout process so it has been 
>>> computed. If you just have a request, try request.session["shipping_total"] 
>>> combined with request.cart.total_price().
>>>
>>>
>>>
>>> Le mercredi 27 mai 2015 13:49:51 UTC+2, Wesley a écrit :
>>>>
>>>> Sorry missing one that:
>>>> I am trying to get the price from checkout confirmation page, I mean, 
>>>> when click "Next" on the page.
>>>>
>>>>
>>>> Hi guys,
>>>>>In one of my views function, I wanna get final total price of the 
>>>>> order.
>>>>>
>>>>> I tried to get from request.session['order']['total'] or 
>>>>> request.session['cart']['something'] but all failed.
>>>>>
>>>>> I print order and cart getting this sample:
>>>>> order is:
>>>>> {'card_name': u'', u'delivery_type': u'', 'remember': True, 
>>>>> 'pay_type': u'\u5fae\u4fe1\u652f\u4ed8', 'billing_detail_street': 
>>>>> u'\u6d4b\u8bd5', 'shipping_detail_first_name': u'\u502a\u6770', 
>>>>> 'shipping_detail_street': u'\u6d4b\u8bd5', u'additional_instructions': 
>>>>> u'', 
>>>>> 'card_type': u'', 'step': 2, 'same_billing_shipping': True, 
>>>>> u'prefer_time': 
>>>>> u'\u7acb\u5373\u9001\u9910', 'shipping_detail_phone': u'11211', 
>>>>> 'billing_detail_email': u'whatever here', 'billing_detail_phone': 
>>>>> u'11211', 
>>>>> 'billing_detail_first_name': u'\u502a\u6770'}
>>>>>
>>>>> cart is:544
>>>>>
>>>>> So, no something like 'total' in order object, and cart is id.
>>>>>
>>>>> Maybe I can get price to query database according to the cart's id, 
>>>>> but is there any easy way to get the total price?
>>>>>
>>>>> Thanks.
>>>>> Wesley
>>>>>
>>>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Mezzanine Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to mezzanine-use...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Stephen McDonald
> http://jupo.org
>  

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] Design to extend cartridge with global location selection

2015-05-28 Thread Wesley
Hi guys,
   This is not an problem but just here to consult with you guys.

When coding these days,  I happen to think about that how to add a 
functionality that dynamic display products by user's location selection.

That is, on my homepage, there is one location select, e.g. New York, 
Boston .etc
When users select New York, all product list related shows only products 
that are  availabe for New York.

So, if I code, I will:
1. Add one product option to Product, maybe named as "location", and values 
are those city names, e.g. "New York", "Boston" .etc
2. Add the selected location variable to request.session
3. Within those product list templates or view functions returning queryset 
to product list pages, filter products 

Is above idea correct? or do you guys has some better suggestions?

Wesley

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Re: Design to extend cartridge with global location selection

2015-05-31 Thread Wesley
Hi Stephen and Mathias,
  Thanks for your reply and that's really good suggestion.
Currently I think customizing @processor_for(Category) is better for my 
current scenario.

Use Category as location is higher level controller I think very useful 
when all products are involved in just on Category(also in the top 
navigation bar).
Currently I have several categories fixed in the top menu and all linked to 
special type of products.

So, it's better for me now to use @processor_for to filter products when 
every category on the top menu is clicked. :-)

Thank you guys.
Wesley

Yeah, great idea hiding the menu items.
>
> Then all you'd need is a couple of small view functions, like the one that 
> sets the session variable, and one that does the redirect to the relevant 
> location category by looking at the session variable - that might end up 
> having a Link page in your menu called "Products" that just links to the 
> redirector.
>
> On Fri, May 29, 2015 at 11:39 PM, Mathias Ettinger  > wrote:
>
>> Indeed,
>>
>> Category can be the (already existing and SQL cheaper version of the) 
>> ManyToMany field I was referring to. You can use the PAGE_MENU_TEMPLATES 
>> checkboxes to make sure they don't appear in the menu if you don't want 
>> them to.
>>
>>
>> Le samedi 30 mai 2015 08:17:57 UTC+2, Stephen McDonald a écrit :
>>>
>>> Might even be able to do something simple using locations as categories.
>>>
>>> On Fri, May 29, 2015 at 11:12 PM, Mathias Ettinger <
>>> mathias@gmail.com> wrote:
>>>
>>>> Hi,
>>>>
>>>> I’d rather not use a variation option to store the location:
>>>>  - it can be costly to retrieve every one of them when filtering 
>>>> products for a given category;
>>>>  - it will display on the product page and can be redundant if you have 
>>>> a dropdown elsewhere.
>>>>
>>>> Instead, I’d rather use EXTRA_MODEL_FIELDS to inject a CharField (or 
>>>> better, a ForeignKey or a ManyToMany, depending on your needs, to a custom 
>>>> model storing locations and may be other metadata) into 
>>>> cartridge.shop.models.Product
>>>> You can then write a custom @processor_for(Category) to filter the 
>>>> products according to your needs. Check out 
>>>> https://github.com/stephenmcd/cartridge/blob/master/cartridge/shop/page_processors.py
>>>>  
>>>> for an example of how to achieve that.
>>>>
>>>>
>>>>
>>>>
>>>> Le jeudi 28 mai 2015 10:55:55 UTC+2, Wesley a écrit :
>>>>>
>>>>> Hi guys,
>>>>>This is not an problem but just here to consult with you guys.
>>>>>
>>>>> When coding these days,  I happen to think about that how to add a 
>>>>> functionality that dynamic display products by user's location selection.
>>>>>
>>>>> That is, on my homepage, there is one location select, e.g. New York, 
>>>>> Boston .etc
>>>>> When users select New York, all product list related shows only 
>>>>> products that are  availabe for New York.
>>>>>
>>>>> So, if I code, I will:
>>>>> 1. Add one product option to Product, maybe named as "location", and 
>>>>> values are those city names, e.g. "New York", "Boston" .etc
>>>>> 2. Add the selected location variable to request.session
>>>>> 3. Within those product list templates or view functions returning 
>>>>> queryset to product list pages, filter products 
>>>>>
>>>>> Is above idea correct? or do you guys has some better suggestions?
>>>>>
>>>>> Wesley
>>>>>
>>>>  -- 
>>>> You received this message because you are subscribed to the Google 
>>>> Groups "Mezzanine Users" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>> an email to mezzanine-use...@googlegroups.com.
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>
>>>
>>> -- 
>>> Stephen McDonald
>>> http://jupo.org
>>>  
>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Mezzanine Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to mezzanine-use...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Stephen McDonald
> http://jupo.org
>  

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] How to add product directly to cart from category page?

2015-08-13 Thread Wesley
Hi guys,
   Currently, I need to place an button(suppose named button1) on each 
product box within category product list page.
So, when user click the button, directly add the bound product to shopping 
cart, and then, the cart icon placed some place else refresh items number 
currently have in cart.

So, I think for the button1, I need to send ajax request to add product to 
cart.
Is there any existing url for adding product to cart? And, how to make cart 
icon display items number in real-time?

If there is no such url, I need to write by myself, I see for Cart model, 
one method named 'add_item', need to call this guy, eh?

Any suggestion or general direction is appreciated.

Thanks.
Wesley

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] How to split out Orderable as app?

2015-08-21 Thread Wesley
Hi guys,
   I find Mezzanine's Orderable is useful for drag and drop related items 
within admin page.

Is it easy to split this guy out as a single app?

Currently, I have another project that is developed upon origin django 
release instead of mezzanine, and I wanna reuse the orderable functionality 
of Mezzanine

Any easy way to do this?

Thanks.
Wesley

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ttyC5, keyboard doesn't work

2012-10-31 Thread Wesley

Le 2012-10-30 12:24, MERIGHI Marcus a écrit :

$ grep ttyC1 /etc/ttys
ttyC1   "/usr/local/sbin/autologin.getty" vt220 on  secure

$ cat /usr/local/sbin/autologin.getty
#!/bin/sh -e
TERM=vt220 /usr/local/sbin/autologin < /dev/$1 > /dev/$1

$ cat /usr/local/sbin/autologin
#!/bin/sh -e
echo running autologin...
exec su -l autologin

$ cat /home/autologin/.profile
/usr/X11R6/bin/startx



Hi,
Thank you very much, now keyboard works, therefore, in each xterm i 
have the following errors :


"
xauth:  file /home/stac/.serverauth.457 does not exist
xauth: (stdin):1:  bad display name "accueil:0" in "add" command

Fatal server error:
Server is already active for display 0
If this server is no longer running, remove /tmp/.X0-lock
and start again.

Please consult the The X.Org Foundation support
 at http://wiki.x.org
 for help.

XIO:  fatal IO error 35 (Resource temporarily unavailable) on X server 
":0"

  after 7 requests (7 known processed) with 0 events remaining"

When start "fwvm", it is possible to disable xterm at startup ?

Again, thank you very much for your precious help!

Cheers,

Wesley



Re: ttyC5, keyboard doesn't work

2012-10-31 Thread Wesley

Hi,

I'm sorry, but i did all you write.
Now when i turn on my OpenBSD Box, i have a pretty GUI, but when i run 
'Terminal', i get these errors :


++
xauth:  file /home/stac/.serverauth.22692 does not exist
Fatal server error:
Server is already active for display 0
If this server is no longer running, remove /tmp/.X0-lock
and start again.
Please consult the The X.Org Foundation support
 at http://wiki.x.org
 for help.
XIO:  fatal IO error 35 (Resource temporarily unavailable) on X server 
":0"

  after 7 requests (7 known processed) with 0 events remaining.
++

I have a user : stac, member of wheel group

my 'ttyC1' from the file /etc/ttys :
ttyC1   "/usr/local/sbin/autologin.getty"   vt220   on  secure

$ userinfo stac
login   stac
passwd  *
uid 1001
groups  users wheel
change  NEVER
class
gecos
dir /home/stac
shell   /bin/ksh
expire  NEVER

$ cat /usr/local/sbin/autologin
#!/bin/sh -e
echo running autologin...
exec su -l stac

$ cat /usr/local/sbin/autologin.getty
#!/bin/sh -e
TERM=vt220 /usr/local/sbin/autologin < /dev/$1 > /dev/$1

$ cat /etc/rc.conf.local
ntpd_flags= # enabled during install
#xdm_flags=

$ ls -la
total 12384
drwxr-xr-x  4 stac  users  512 Oct 31 17:01 .
drwxr-xr-x  3 root  wheel  512 Oct 11 16:55 ..
-rw---  1 stac  users  163 Oct 31 16:56 .Xauthority
-rw-r--r--  1 stac  users   62 Oct 12 11:56 .Xdefaults
-rw---  1 stac  users   16 Oct 31 11:58 .aucat_cookie
-rw-r--r--  1 stac  users  773 Feb 12  2012 .cshrc
-rw-r--r--  1 stac  users 2146 Oct 31 16:50 .fvwmrc
-rw-r--r--  1 stac  users  398 Feb 12  2012 .login
-rw-r--r--  1 stac  users  113 Feb 12  2012 .mailrc
drwx--  4 stac  users  512 Oct 12 09:56 .mozilla
-rw-r--r--  1 stac  users  240 Oct 31 12:28 .profile
-rw---  1 stac  users   52 Oct 31 16:56 .serverauth.12948
drwx--  2 stac  users  512 Oct 12 12:00 .ssh
-rw-r--r--  1 stac  users  167 Oct 31 16:48 .xinitrc
-rw---  1 stac  users0 Oct 31 11:06 .xsession-errors
-rw---  1 stac  users  6290352 Oct 15 08:55 firefox.core

$ cat .Xdefaults
XTerm*loginShell:true
XTerm*faceName: Mono
Xterm*faceSize: 14

Any idea ?
Therefore, i like a lot what you did with fvwm! It is pretty cool ! ;-)

Cheers,

Wesley

Le 2012-10-31 13:22, MERIGHI Marcus a écrit :

Hello Wesley,

note: ``autologin'' is a regular user in my case. I never saw the
X.org errors you mention.




Re: ttyC5, keyboard doesn't work

2012-11-01 Thread Wesley

Le 2012-10-31 17:30, MERIGHI Marcus a écrit :

I would try in .Xdefaults

XTerm*loginShell:false

OR

you could do the following in .profile:
pgrep -f -x "/usr/X11R6/bin/X .*" || /usr/X11R6/bin/xinit



Hi,

I tried both solutions.
No error messages, but keyboard doesn't work.

Cheers,

Wesley



Re: ttyC5, keyboard doesn't work : solved

2012-11-02 Thread Wesley

I just put this in my .profile :
echo "running X ..." && /bin/sleep 5 && /usr/X11R6/bin/startx

--
Wesley


Le 2012-11-02 9:25, Wesley a écrit :

Le 2012-10-31 17:30, MERIGHI Marcus a écrit :

I would try in .Xdefaults

XTerm*loginShell:false

OR

you could do the following in .profile:
pgrep -f -x "/usr/X11R6/bin/X .*" || /usr/X11R6/bin/xinit



Hi,

I tried both solutions.
No error messages, but keyboard doesn't work.

Cheers,

Wesley




OpenBSD 5.2 Tos / AckPri

2012-11-05 Thread Wesley

Hi,

In OpenBSD 5.2, does this line : "pass all tos lowdelay" do the same 
job that using altq/priq (see below)?


ext_if="kue0"
altq on $ext_if priq bandwidth 100Kb queue { q_pri, q_def }
queue q_pri priority 7
queue q_def priority 1 priq(default)
pass out on $ext_if proto tcp from $ext_if to any flags S/SA \
keep state queue (q_def, q_pri)

from this : http://www.benzedrine.cx/ackpri.html

Thank you very much for your replies.

Cheers,

Wesley.



a pf ruleset 5.2

2012-11-05 Thread Wesley

Hi,

I just built a small firewall using OpenBSD 5.2
Advices are welcome... ;-)

Thank you very much.

So, 2 interfaces, with the following rules :

-Traffic only Ipv4
-Allow pings in/out
-Allow our lan to only have ftp/http and https
-Allow an access from anywhere to our RDP server
-Prioritizing Acks

*
lan=rl0
allow="{www,ftp,https}"
rdphost="10.0.0.10"

set skip on lo
set block-policy return

match in all scrub (no-df max-mss 1440)
match out on egress inet from $lan:network to any nat-to egress

block log all

anchor "ftp-proxy/*"
pass in quick inet proto tcp to port ftp divert-to 127.0.0.1 port 8021

pass out on egress inet proto tcp set prio (1,7)
pass out on egress inet proto udp
pass out on $lan inet

pass in on $lan proto udp from $lan:network to port domain
pass in on $lan proto tcp from $lan:network to port $allow
pass inet proto icmp all icmp-type echoreq

pass in on egress inet proto tcp from any to any port 3389 \
 rdr-to $rdphost tag rdp set prio (1,7)
pass out on $lan tagged rdp
*****

Cheers,

Wesley



Re: How to list available all hard disks in OpenBSD

2012-12-20 Thread Wesley

Hi,

you can try this :


/usr/sbin/sysctl hw.disknames

Cheers,
Wesley


Le 2012-12-21 7:17, Indunil Jayasooriya a écrit :

HI,

I would like to know How to list available all hard disks in OpenBSD 
?


If I run below 2 commands, it will give an output.

dmesg |grep wd0

fdisk wd0


If I install a new Hard Disk, How to get to know whether it is wd1 or
anything eles?

In Linux, Fdisk -l show all the available hard disks. In OpenBSD 
what's the

command for it?




Re: List of all software present on OpenBSD 5.2

2012-12-26 Thread Wesley

Le 2012-12-26 19:46, Live user a écrit :

Where can I find all the software that comes
in install52.iso?


Please, read the famous OpenBSD FAQ :
1.8 - What is included with OpenBSD?
Here it is : http://www.openbsd.org/faq/faq1.html#Included

Cheers,

Wesley MOUEDINE ASSABY



Re: how to save /home during reinstall

2012-12-27 Thread Wesley

Le 2012-12-27 14:15, lilit-aibolit a écrit :

Hello misc.
I have a /home at old system and I want
to install new one from scratch.
But I need to save all data in /home without
moving it out of box.
As I understood I need to stop at this point:

Use (W)hole disk or (E)dit the MBR? [whole]


At this prompt, hit Ctrl+C or "!" and
Why don't you mount a second disk and backup /home to
this one? just before fdisk part.

Cheers,
Wesley



/var/backups strange behaviour

2013-01-07 Thread Wesley

Hi

Before do anything, i read this : man 8 daily
I just installed a fresh OpenBSD-5.2
and /var/backups : empty

I don't understand why backup is enabled in /var/backups.
I explain, if i run the script : 'sh /etc/daily', backups is done.
(i.e 'ls /var/backups')

In the manpage of daily, it will backup only if :
ROOTBACKUP Variable is enable (=1)
or altroot partition in /etc/fstab
Actually none of these 2 statements are present. Any idea ?

Thank you very much.

Regards,

Wesley



Re: Nonexistant domains resolve to my local domain

2014-04-10 Thread Wesley

On 10.04.2014 13:41, Stuart Henderson wrote:

Try "ASR_DEBUG=1 ping somehost" and post the result..


Very useful, where can we find informations about these kind of
variables like LD_DEBUG, ASR_DEBUG or other ??

Thank you very much



Re: Shell account service providers

2020-07-15 Thread Wesley




Ibsen S Ripsbusker wrote:

Are there services that sell managed OpenBSD shell accounts?
I mean a service similar to sdf.org.


Try google with keywords "online unix terminal for shell scripting", you 
will find a lot results.


regards.



Re: Crash on TOSHIBA PORTEGE Z30-A laptop

2023-10-21 Thread wesley
Hi Philip,

Thank you very much for your answer.

I tried to disable all options (+devices) possible. Same issue.
And what's about disable acpi in the kernel using the bsd.re-config?

Do you think If I replace the wireless card by somthing else, It could resolve 
this issue?


/Wesley 



-Message d'origine-
De : owner-b...@openbsd.org  De la part de Philip 
Guenther
Envoyé : samedi 21 octobre 2023 03:23
À : wes...@technicien.io
Cc : b...@openbsd.org; misc@openbsd.org
Objet : Re: Crash on TOSHIBA PORTEGE Z30-A laptop

On Fri, Oct 20, 2023 at 1:23 PM  wrote:

> I've recently installed OpenBSD 7.4 on this laptop.
>
> However, I'm experiencing random crashes. These occur at various 
> times, including during kernel loading (before running /etc/rc),
>
> or later while I'm using the system.
>
>
> I've included the contents of /var/run/dmesg.boot below and attached 
> the screens with the ddb output command.
>
...

> bios0: vendor TOSHIBA version "Version 4.30" date 04/26/2018
>

The screenshots show that the fault happens during a wifi interrupt that 
catches the ACPI thread processing a very deeply nested AML code.  I suspect 
it's actually running out of kernel stack space as a result.
Everything below is based on that hypothesis.

So, the first thing to try is to see if there's a BIOS update newer than the 
2018 rev it currently has.  They may have optimized the AML code, or at least 
made it less deeply nested.

Another possibility is to see if there's a device you can disable that would 
result in that AML not being called.  If there's anything that you aren't using 
then disable it in the BIOS and hope.

The last possibility would be to build a kernel which allocates more pages per 
thread for its kernel stack by bumping the UPAGES #define in 
/usr/src/sys/arch/amd64/include/param.h and building a new kernel.  It's really 
only the ACPI thread that needs this, but we don't currently have code to 
control that on a per-thread basis.


Philip Guenther



Re: Crash on TOSHIBA PORTEGE Z30-A laptop

2023-10-23 Thread wesley
> If there isn't a newer BIOS that resolves this, I would tend to return the 
> box as not suitable.



This is the case, there’s no BIOS update.

Thank you very much, anyway.

Cheers,


/Wesley

 

De : Philip Guenther  
Envoyé : lundi 23 octobre 2023 00:39
À : wes...@technicien.io
Cc : b...@openbsd.org; misc@openbsd.org
Objet : Re: Crash on TOSHIBA PORTEGE Z30-A laptop

 

On Sat, Oct 21, 2023 at 2:27 AM mailto:wes...@technicien.io> > wrote:

Hi Philip,

Thank you very much for your answer.

I tried to disable all options (+devices) possible. Same issue.
And what's about disable acpi in the kernel using the bsd.re-config?

 

As Mike and Theo noted, this will certainly cause problems.

 

 

Do you think If I replace the wireless card by somthing else, It could resolve 
this issue?

 

Very unlikely.  The problem is the stack depth of the ACPI processing.  The 
crash you saw had the wifi interrupt occur during the ACPI processing but it 
could just as well happen with some other device interrupting the ACPI 
processing.

 

If there isn't a newer BIOS that resolves this, I would tend to return the box 
as not suitable.

 

 

Phlip Guenther



Re: My OpenBSD 5.0 installation experience (long rant)

2012-03-09 Thread Wesley
On 07.03.2012 16:26, Leonardo Sabino dos Santos wrote: 

"Next, the
disk stuff comes up. A lot of partition information appears
on the
screen, followed by the question:

 Use (W)hole disk or (E)dit the MBR?
[whole]"

You need to read !!! All is explained in the sentence !

Sorry
to tell you that, but i never seen a better FAQ than OpenBSD FAQ !
All
is well described ! Again, you just only have to read the FAQ !! And of
course have his head on his shoulders !!

And to finish, OpenBSD
Installation is very very easy !! What you said, this is the wrong time,
that's all ! ;-)

Wesley.



dmesg mac mini A1347

2012-03-11 Thread Wesley
0 vendor "TI", unknown product 0x823e rev 0x01
pci2
at ppb1 bus 2
vendor "TI", unknown product 0x823f (class serial bus
subclass Firewire, rev 0x01) at pci2 dev 0 function 0 not
configured
ppb2 at pci0 dev 21 function 0 "NVIDIA MCP89 PCIE" rev 0xa1:
apic 1 int 16
pci3 at ppb2 bus 3
"Broadcom BCM43224" rev 0x01 at pci3
dev 0 function 0 not configured
ppb3 at pci0 dev 22 function 0 "NVIDIA
MCP89 PCIE" rev 0xa1: apic 1 int 11
pci4 at ppb3 bus 4
bge0 at pci4 dev
0 function 0 "Broadcom BCM57765" rev 0x00, unknown BCM57765
(0x57785000): apic 1 int 11, address c4:2c:03:02:f6:1e
ukphy0 at bge0
phy 1: Generic IEEE 802.3u media interface, rev. 0: OUI 0x00d897, model
0x0024
sdhc0 at pci4 dev 0 function 1 "Broadcom SD Host Controller" rev
0x00: apic 1 int 16
sdhc0 at 0x10: can't map registers
ppb4 at pci0 dev
23 function 0 "NVIDIA MCP89 PCIE" rev 0xa1
pci5 at ppb4 bus 5
vga1 at
pci5 dev 0 function 0 vendor "NVIDIA", unknown product 0x08a4 rev
0xa2
wsdisplay0 at vga1 mux 1: console (80x25, vt100
emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
isa0 at
pcib0
isadma0 at isa0
pcppi0 at isa0 port 0x61
spkr0 at pcppi0
npx0 at
isa0 port 0xf0/16: reported by CPUID; using exception 16
usb2 at ohci0:
USB revision 1.0
uhub2 at usb2 "NVIDIA OHCI root hub" rev 1.00/1.00 addr
1
usb3 at ohci1: USB revision 1.0
uhub3 at usb3 "NVIDIA OHCI root hub"
rev 1.00/1.00 addr 1
mtrr: Pentium Pro MTRR support
uhidev0 at uhub2
port 4 configuration 1 interface 0 "LITEON Technology USB Multimedia
Keyboard" rev 1.10/1.01 addr 2
uhidev0: iclass 3/1
ukbd0 at uhidev0: 8
modifier keys, 6 key codes
wskbd0 at ukbd0: console keyboard, using
wsdisplay0
uhidev1 at uhub3 port 5 configuration 1 interface 0 "Apple
Computer, Inc. IR Receiver" rev 2.00/0.16 addr 2
uhidev1: iclass 3/0, 38
report ids
uhid0 at uhidev1 reportid 36: input=4, output=0,
feature=0
uhid1 at uhidev1 reportid 37: input=4, output=0,
feature=0
uhid2 at uhidev1 reportid 38: input=4, output=0,
feature=0
uhub4 at uhub3 port 6 "Apple Inc. BRCM2070 Hub" rev 2.00/1.00
addr 3
uhidev2 at uhub4 port 1 configuration 1 interface 0 "Apple
Computer product 0x820a" rev 2.00/1.00 addr 4
uhidev2: iclass 3/1, 1
report id
ukbd1 at uhidev2 reportid 1: 8 modifier keys, 6 key
codes
wskbd1 at ukbd1 mux 1
wskbd1: connecting to wsdisplay0
uhidev3 at
uhub4 port 2 configuration 1 interface 0 "Apple Computer product 0x820b"
rev 2.00/1.00 addr 5
uhidev3: iclass 3/1, 2 report ids
ums0 at uhidev3
reportid 2: 3 buttons
wsmouse0 at ums0 mux 0
ugen0 at uhub4 port 3
"Apple Inc. Bluetooth USB Host Controller" rev 2.00/0.22 addr 6
vscsi0
at root
scsibus1 at vscsi0: 256 targets
softraid0 at root
scsibus2 at
softraid0: 256 targets
root on wd0a (47aee65d7d82f5b5.a) swap on wd0b
dump on wd0b

Thank you very much!

Cheers, 

Wesley MOUEDINE ASSABY



Re: dmesg mac mini A1347

2012-03-12 Thread Wesley
Already done.

On 12.03.2012 11:24, Sebastian Benoit wrote: 

>
Wesley(open...@e-solutions.re) on 2012.03.12 09:51:59 +0400:
> 
>> Hi,
hw.sensors.cpu0.temp0=53.00 degC Here the dmesg running OpenBSD 5.0
RELEASE:
> 
> you should send this to dm...@openbsd.org, not misc ;-)
>
http://www.openbsd.org/faq/faq4.html#SendDmesg
> 
> /Benno



Re: dmesg mac mini A1347

2012-03-13 Thread Wesley
Hi 

Yes i can test it. Keep you informed about it.
Cheers, 

Wesley
MOUEDINE ASSABY

On 14.03.2012 05:18, Brad Smith wrote: 

> Hi Wesley,
>

> Would you be able to build a kernel with the following diff
> applied
and send me the dmesg from the new kernel?
> 
> Index:
sys/dev/pci/nviic.c
>
===
>
RCS file: /home/cvs/src/sys/dev/pci/nviic.c,v
> retrieving revision
1.15
> diff -u -p -r1.15 nviic.c
> --- sys/dev/pci/nviic.c 8 Apr 2010
00:23:53 - 1.15
> +++ sys/dev/pci/nviic.c 14 Mar 2012 00:41:22
-
> @@ -125,7 +125,8 @@ const struct pci_matchid nviic_ids[] = {
> {
PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP67_SMB },
> {
PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP73_SMB },
> {
PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP77_SMB },
> - {
PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP79_SMB }
> + {
PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP79_SMB },
> + {
PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP89_SMB }
> };
> 
> int



ikev2 between an OpenBSD Gateway and a win7 road warrior

2012-04-02 Thread Wesley
Hi, 

I'm using an OpenBSD Gateway running :
OpenBSD vpn.area.lan
5.1 GENERIC.MP#214 i386 

So what i'm trying to build
:
<10.10.0.0/24>rl0[obsd]rl1(INTERNET)(win7 with
dynamic IP)

IP Address (INTERNET, rl1) : AA.BB.CC.DD
Dynamic IP for
win7 : RR.WW.RR.WW 

I start the ikev2 vpn (it stop on password and user
verification) and have this on the OBSD gateway : 

tail -f
/var/log/daemon :
Apr 2 12:13:22 vpn iked[19494]: ikev2_recv:
IKE_SA_INIT from initiator RR.WW.RR.WW:59317 to AA.BB.CC.DD:500 policy
'win7', 528 bytes
Apr 2 12:13:22 vpn iked[19494]: ikev2_msg_send:
IKE_SA_INIT fromAA.BB.CC.DD:500 to RR.WW.RR.WW:59317, 325 bytes
Apr 2
12:13:22 vpn iked[19494]: ikev2_recv: IKE_AUTH from initiator
RR.WW.RR.WW:58268 to AA.BB.CC.DD:4500 policy 'win7', 1164 bytes

Any
idea ?
Thank you very much.

-- OpenBSD Gateway :

rl0 group : lan
rl1
group : egress 

IP Address (INTERNET, rl1) : AA.BB.CC.DD 

iked.conf
:
user "bandit" "123456"
ikev2 "win7" passive esp 
 from 10.10.3.0/24 to
10.10.0.0/24 
 local any peer any 
 eap "mschap-v2" 
 config address
10.10.3.7 
 config name-server 10.10.0.51 
 tag "$name-$id"

pf.conf
:
set skip on {lo,enc0}
set block-policy drop
match out on egress from
lan:network to any nat-to egress
block log all
pass out
pass in on
egress proto esp
pass in on egress proto udp to port 500
pass in on
egress proto udp to port 4500
pass in on egress proto tcp to port
22
pass in on lan inet from lan:network to any 

net.inet.ip.forwarding
= 1

What i have done about certificates :
ikectl ca vpn create
ikectl
ca vpn certificate AA:BB:CC:DD create
ikectl ca vpn install
ikectl ca
vpn certificate AA:BB:CC:DD install
ikectl ca vpn certificate
AA:BB:CC:DD export 

I put the certs exported on the win7 workstation.


And then run iked. 

-- Win7 workstation
Import certificate in mmc
snap (Certificates/Authority)

Wesley. 



Re: ikev2 between an OpenBSD Gateway and a win7 road warrior

2012-04-02 Thread Wesley
Sorry for the message form.
Here is better :
http://pastebin.com/dxTrasGM 

Thank you for your help. 

Or : 

*

I'm using an OpenBSD Gateway running : 
* 
OpenBSD vpn.area.lan 5.1
GENERIC.MP#214 i386 
* 

* 
So what i'm trying to build: 
*

<10.10.0.0/24>rl0[obsd]rl1(INTERNET)(win7 with
dynamic IP) 
* 

* 
IP Address (INTERNET, rl1) : AA.BB.CC.DD 
*

Dynamic IP for win7 : RR.WW.RR.WW 
* 

* 
I start the ikev2 vpn (it
stop on password and user 
* 
verification) and have this on the OBSD
gateway : 
* 

* 
tail -f /var/log/daemon : 
* 
Apr 2 12:13:22 vpn
iked[19494]: ikev2_recv: IKE_SA_INIT from initiator RR.WW.RR.WW:59317 to
AA.BB.CC.DD:500 policy 'win7', 528 bytes 
* 
Apr 2 12:13:22 vpn
iked[19494]: ikev2_msg_send: IKE_SA_INIT fromAA.BB.CC.DD:500 to
RR.WW.RR.WW:59317, 325 bytes 
* 
Apr 2 12:13:22 vpn iked[19494]:
ikev2_recv: IKE_AUTH from initiator RR.WW.RR.WW:58268 to
AA.BB.CC.DD:4500 policy 'win7', 1164 bytes 
* 

* 
Any idea ? 
*

Thank you very much. 
* 

* 
-- OpenBSD Gateway : 
* 

* 
rl0
group : lan 
* 
rl1 group : egress 
* 

* 
IP Address (INTERNET,
rl1) : AA.BB.CC.DD 
* 

* 
iked.conf: 
* 
user "bandit" "123456" 

* 
ikev2 "win7" passive esp from 10.10.3.0/24 to 10.10.0.0/24 
* 

local any peer any 
* 
 eap "mschap-v2" 
* 
 config address
10.10.3.7 
* 
 config name-server 10.10.0.51 
* 
 tag "$name-$id" 

* 

* 
pf.conf: 
* 
set skip on {lo,enc0} 
* 
set block-policy
drop 
* 
match out on egress from lan:network to any nat-to egress 

* 
block log all 
* 
pass out 
* 
pass in on egress proto esp 
*

pass in on egress proto udp to port 500 
* 
pass in on egress proto
udp to port 4500 
* 
pass in on egress proto tcp to port 22 
* 
pass
in on lan inet from lan:network to any 
* 

*

net.inet.ip.forwarding 
* 
= 1 
* 

* 
What i have done about
certificates : 
* 
ikectl ca vpn create 
* 
ikectl ca vpn
certificate AA.BB.CC.DD create 
* 
ikectl ca vpn install 
* 
ikectl
ca vpn certificate AA.BB.CC.DD install 
* 
ikectl ca vpn certificate
AA.BB.CC.DD export 
* 

* 
I put the certs exported on the win7
workstation. 
* 
And then run iked. 
* 

* 
-- Win7 workstation 

* 
Import certificate in mmc snap (Certificates/Authority) 



<    1   2   3   4   5   6   7   8   9   10   >