[mezzanine-users] (bound method) print blog post form as html form in python shell error

2015-03-31 Thread Bnh Dc
i try to generate BlogPostForm in blog\forms.py as html form but output 
show a error

>>> f.as_table
>
>>>

>>> f.as_table()
Traceback (most recent call last):
  File "", line 1, in 
  File 
"C:\Users\DC\Documents\newProject\env\lib\site-packages\django\forms\form
s.py", line 257, in as_table
errors_on_separate_row=False)
  File 
"C:\Users\DC\Documents\newProject\env\lib\site-packages\django\forms\form
s.py", line 219, in _html_output
'field': six.text_type(bf),
  File 
"C:\Users\DC\Documents\newProject\env\lib\site-packages\django\forms\form
s.py", line 508, in __str__
return self.as_widget()
  File 
"C:\Users\DC\Documents\newProject\env\lib\site-packages\django\forms\form
s.py", line 560, in as_widget
return force_text(widget.render(name, self.value(), attrs=attrs))
  File 
"C:\Users\DC\Documents\newProject\env\lib\site-packages\filebrowser_safe\
fields.py", line 50, in render
fullpath = os.path.join(get_directory(), directory)
  File 
"C:\Users\DC\Documents\newProject\env\lib\site-packages\filebrowser_safe\
functions.py", line 35, in get_directory
if not default_storage.isdir(fullpath):
  File 
"C:\Users\DC\Documents\newProject\env\lib\site-packages\django\utils\func
tional.py", line 225, in inner
return func(self._wrapped, *args)
AttributeError: 'FileSystemStorage' object has no attribute 'isdir'
>>>


how to print BlogPostForm correctly?

-- 
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] front-end add blog post for none admin user

2015-03-31 Thread Bnh Dc
Thank you so much!
Can I ask you some other questions?
in the code below, what form id quick-blog-form come from?
When I include form in admin\includes\quick_blog.html, it didn't appear in 
the web site as the picture in the first post. Did i miss something?



{% trans "Quick Post" %}

{% csrf_token %}

{{ form.as_table }}

 








On Wednesday, April 1, 2015 at 7:17:21 AM UTC+7, Mario Gudelj wrote:
>
> Hi Bhn,
>
> All you have to do is to create a form which uses the blog model like this:
>
> class PostForm(forms.ModelForm):
> class Meta:
> model = BlogPost
>
> Make sure you use either "fields" or "exclude" to only render the fields 
> you need. 
>
> Then you need a view which will process the form. A simple view that will 
> except the POST and save the blog post will do. 
>
> Just standard Django stuff really. If you tell us more about where you're 
> stuck perhaps we can help further.
>
> Cheers,
>
> M
>
>
>
> P: +61 2 9281 3315
> M: +61 415 193775
> E: ma...@twoblokeswithapostie.com 
> W: www.twoblokeswithapostie.com
>
>
>
>
> On Tue, Mar 31, 2015 at 8:00 PM, Bnh Dc > 
> wrote:
>
>> Hi everybody, I'm new to django and mezzanine.
>> I'm doing a project base on this website: http://itrc.hanu.vn  and my 
>> teacher required that the website must allow user to post new aticle from a 
>> front-end site. i try to use form of quick blog which include in tempalte 
>> but it didn't work.
>> can anyone tell me what should i do?
>>
>> p/s: sorry for my english.
>>
>>
>> <https://lh3.googleusercontent.com/-utUa6cWzObg/VRphErVrE1I/BjY/TX3EMhy7vxM/s1600/Capture.PNG>
>>
>> -- 
>> 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] front-end add blog post for none admin user

2015-03-31 Thread Bnh Dc
Thank Josh, I will try.

On Tuesday, March 31, 2015 at 8:55:37 PM UTC+7, Josh Cartmell wrote:
>
> I would make a ModelForm 
> <https://docs.djangoproject.com/en/1.7/topics/forms/modelforms/#modelform> 
> of the BlogPost model and then render it somewhere on the front end
>
> On Tue, Mar 31, 2015 at 5:00 AM, Bnh Dc > 
> wrote:
>
>> Hi everybody, I'm new to django and mezzanine.
>> I'm doing a project base on this website: http://itrc.hanu.vn  and my 
>> teacher required that the website must allow user to post new aticle from a 
>> front-end site. i try to use form of quick blog which include in tempalte 
>> but it didn't work.
>> can anyone tell me what should i do?
>>
>> p/s: sorry for my english.
>>
>>
>> <https://lh3.googleusercontent.com/-utUa6cWzObg/VRphErVrE1I/BjY/TX3EMhy7vxM/s1600/Capture.PNG>
>>
>> -- 
>> 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] front-end add blog post for none admin user

2015-03-31 Thread Bnh Dc
Hi everybody, I'm new to django and mezzanine.
I'm doing a project base on this website: http://itrc.hanu.vn  and my 
teacher required that the website must allow user to post new aticle from a 
front-end site. i try to use form of quick blog which include in tempalte 
but it didn't work.
can anyone tell me what should i do?

p/s: sorry for my english.



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