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

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


div class=module
h2{% trans Quick Post %}/h2
form method=post id=*quick-blog-form* action={% url 
admin:blog_blogpost_add %}
{% csrf_token %}
table id=quick-blog
{{ form.as_table }}
tr
tdnbsp;/td
td style=width:100%;text-align:right;
input type=submit class=save
value={% trans Save Draft %} /
/td
/tr
/table
/form
/div

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 javascript:
 W: www.twoblokeswithapostie.com




 On Tue, Mar 31, 2015 at 8:00 PM, Bnh Dc ldc...@gmail.com javascript: 
 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 javascript:.
 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] Trying to integrate Mezzanine to another project

2015-03-31 Thread Melvin Ramos
Now I'm having this issue and I can't find an answer that points me 
somewhere:

AttributeError at /

'int' object has no attribute 'set_helpers'

Request Method:   GET

Request URL:http://localhost:8000/

Django Version:   1.6.10

Exception Type:   AttributeError

Exception Value: 

'int' object has no attribute 'set_helpers'

Exception Location:
/home/elanor/Documentos/Pasantia/env/local/lib/python2.7/site-packages/mezzanine/pages/context_processors.py
 
in page, line 18

Python Executable:/home/elanor/Documentos/Pasantia/env/bin/python

Python Version:  2.7.6

Python Path: 

['/home/elanor/Documentos/Pasantia/rle/geonode',

 '/home/elanor/Documentos/Pasantia/env/lib/python2.7',

 '/home/elanor/Documentos/Pasantia/env/lib/python2.7/plat-x86_64-linux-gnu',

 '/home/elanor/Documentos/Pasantia/env/lib/python2.7/lib-tk',

 '/home/elanor/Documentos/Pasantia/env/lib/python2.7/lib-old',

 '/home/elanor/Documentos/Pasantia/env/lib/python2.7/lib-dynload',

 '/usr/lib/python2.7',

 '/usr/lib/python2.7/plat-x86_64-linux-gnu',

 '/usr/lib/python2.7/lib-tk',

 '/home/elanor/Documentos/Pasantia/env/local/lib/python2.7/site-packages',

 '/home/elanor/Documentos/Pasantia/rle/geonode']

Server time:  Tue, 31 Mar 2015 20:25:51 -0430

Traceback Switch to copy-and-paste view

 

/home/elanor/Documentos/Pasantia/env/local/lib/python2.7/site-packages/django/core/handlers/base.py
 
in get_response

response = response.render() ...

▶ Local vars

/home/elanor/Documentos/Pasantia/env/local/lib/python2.7/site-packages/django/template/response.py
 
in render

self.content = self.rendered_content ...

▶ Local vars

/home/elanor/Documentos/Pasantia/env/local/lib/python2.7/site-packages/django/template/response.py
 
in rendered_content

context = self.resolve_context(self.context_data) ...

▶ Local vars

/home/elanor/Documentos/Pasantia/env/local/lib/python2.7/site-packages/django/template/response.py
 
in resolve_context

return RequestContext(self._request, context, 
current_app=self._current_app) ...

▶ Local vars

/home/elanor/Documentos/Pasantia/env/local/lib/python2.7/site-packages/django/template/context.py
 
in __init__

self.update(processor(request)) ...

▶ Local vars

/home/elanor/Documentos/Pasantia/env/local/lib/python2.7/site-packages/mezzanine/pages/context_processors.py
 
in page

page.set_helpers(context) ...

I know that in the pages app of mezzanine, in the models.py is defined the 
method set_helpers. So, why django is thinking that the page object is an 
int?

Any ideas?


El martes, 31 de marzo de 2015, 19:30:59 (UTC-4:30), Melvin Ramos escribió:

 Yea, it did! Thanks I'm so burned right now I missed that answer

 El martes, 31 de marzo de 2015, 19:00:29 (UTC-4:30), Graham Oliver 
 escribió:

 Perhaps the top answer here can help?

 http://stackoverflow.com/questions/2606194/django-error-message-add-a-related-name-argument-to-the-definition

 On 1 April 2015 at 12:27, Melvin Ramos melvin.r...@gmail.com wrote:

 Hello,

 I'm tryin to integrate Mezzanine to GeoNode. I added all I needed in 
 settings.py but this error appears:

 CommandError: One or more models did not validate:
 agon_ratings.rating: Accessor for field 'content_type' clashes with 
 related field 'ContentType.rating_set'. Add a related_name argument to the 
 definition for 'content_type'.
 generic.rating: Accessor for field 'content_type' clashes with related 
 field 'ContentType.rating_set'. Add a related_name argument to the 
 definition for 'content_type'.

 And I have no idea what it is. Can you help me? Have anyone tried 
 anything like this before?

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




 -- 
 t : 021 081 71732
  


-- 
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 ldc...@gmail.com javascript: 
 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 javascript:.
 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] Trying to integrate Mezzanine to another project

2015-03-31 Thread Melvin Ramos
Hello,

I'm tryin to integrate Mezzanine to GeoNode. I added all I needed in 
settings.py but this error appears:

CommandError: One or more models did not validate:
agon_ratings.rating: Accessor for field 'content_type' clashes with related 
field 'ContentType.rating_set'. Add a related_name argument to the 
definition for 'content_type'.
generic.rating: Accessor for field 'content_type' clashes with related 
field 'ContentType.rating_set'. Add a related_name argument to the 
definition for 'content_type'.

And I have no idea what it is. Can you help me? Have anyone tried anything 
like this before?

-- 
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] Trying to integrate Mezzanine to another project

2015-03-31 Thread Graham Oliver
Perhaps the top answer here can help?
http://stackoverflow.com/questions/2606194/django-error-message-add-a-related-name-argument-to-the-definition

On 1 April 2015 at 12:27, Melvin Ramos melvin.ramos1...@gmail.com wrote:

 Hello,

 I'm tryin to integrate Mezzanine to GeoNode. I added all I needed in
 settings.py but this error appears:

 CommandError: One or more models did not validate:
 agon_ratings.rating: Accessor for field 'content_type' clashes with
 related field 'ContentType.rating_set'. Add a related_name argument to the
 definition for 'content_type'.
 generic.rating: Accessor for field 'content_type' clashes with related
 field 'ContentType.rating_set'. Add a related_name argument to the
 definition for 'content_type'.

 And I have no idea what it is. Can you help me? Have anyone tried anything
 like this before?

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




-- 
t : 021 081 71732

-- 
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] Trying to integrate Mezzanine to another project

2015-03-31 Thread Melvin Ramos
Yea, it did! Thanks I'm so burned right now I missed that answer

El martes, 31 de marzo de 2015, 19:00:29 (UTC-4:30), Graham Oliver escribió:

 Perhaps the top answer here can help?

 http://stackoverflow.com/questions/2606194/django-error-message-add-a-related-name-argument-to-the-definition

 On 1 April 2015 at 12:27, Melvin Ramos melvin.r...@gmail.com 
 javascript: wrote:

 Hello,

 I'm tryin to integrate Mezzanine to GeoNode. I added all I needed in 
 settings.py but this error appears:

 CommandError: One or more models did not validate:
 agon_ratings.rating: Accessor for field 'content_type' clashes with 
 related field 'ContentType.rating_set'. Add a related_name argument to the 
 definition for 'content_type'.
 generic.rating: Accessor for field 'content_type' clashes with related 
 field 'ContentType.rating_set'. Add a related_name argument to the 
 definition for 'content_type'.

 And I have no idea what it is. Can you help me? Have anyone tried 
 anything like this before?

 -- 
 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 javascript:.
 For more options, visit https://groups.google.com/d/optout.




 -- 
 t : 021 081 71732
  

-- 
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 Mario Gudelj
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 ldc...@gmail.com 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-users+unsubscr...@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.