[mezzanine-users] Models are not working
I have created Models like *models.py file:* from django.db import models from mezzanine.pages.models import Page class Author(Page): dob = models.DateField(Date of birth) I am using Wamp to save database/tables. My database name is abcdef * tables have created in my database now. but models are not working, tables define in models are not created.* Note: I have mention south in my Installed Apps. -- 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] What to do next?
*processor_for.py* from django import forms from django.http import HttpResponseRedirect from mezzanine.pages.page_processors import processor_for from .models import Book class BookForm(forms.Form): name = forms.CharField() email = forms.EmailField() @processor_for(Author) def author_form(request, page): form = BookForm() if request.method == POST: form =BookForm(request.POST) if form.is_valid(): # Form processing goes here. redirect = request.path + ?submitted=true return HttpResponseRedirect(redirect) return {form: form} *models.py* from django.db import models from time import time class Book(models.Model): book_name= models.CharField(max_length=200, unique = True) def __unicode__(self): return self.book_name *views.py* def create_book (request): if request.POST: form = BookForm(request.POST, request.FILES) if form.is_valid(): form.save() return HttpResponseRedirect('/all/') else: form = BookForm() args= {} args.update(csrf(request)) args['form'] = form return render_to_response('create_Book.html', args) *urls.py* urlpatterns += patterns('', url(r'^/xyz/$', create_user)) *create_Book.html* form action=/createuser/ method=post enctype=multipart/form-data{% csrf_token %} {{form.as_ul}} input type=submit name=submit value=create/ /form This is what i am doing but still i am unable to access form. Where i am doing wrong. will be grateful to you. Please mark that what's wrong in code? -- 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 set menus and to get postedata in Mezzanine Django
thank's ! hmm can you answer my second question, i posted today with title `what to do next`! -- 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] Page Processors with Slug
page_processor.py defining restaurant function. How to define url to access this function can you please write this line of code? -- 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] Page Processors are not working!
processors.py file: from django import forms from django.http import HttpResponseRedirect from mezzanine.pages.page_processors import processor_for from .models import Author class AuthorForm(forms.Form): name = forms.CharField() email = forms.EmailField() @processor_for(Author) def author_form(request, page): form = AuthorForm() if request.method == POST: form = AuthorForm(request.POST) if form.is_valid(): # Form processing goes here. redirect = request.path + ?submitted=true return HttpResponseRedirect(redirect) return {form: form} here define urls.py file where i define processor like: url(^xyz/$, mezzanine.pages.views.page, {Author: /xyz/}, name=Author), Now it says: author is undefined. how to solve this error so form may work, -- 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: Issues with page processors in Mezzanine
Excellent Explanation of page processor. I was lokking for such explanation from last 2 days. Good job @Eduardo -- I am trying to achieve this goal too. can you please help me to solve similar problem https://groups.google.com/forum/#!topic/mezzanine-users/D9Gjp_jOQNM%5B1-25-false%5D Looking forward to your reply Thank's -- 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: Page Processors are not working!
Yes author is model @Josh Thank's Allah, i solve this problem. What i did is i decided to start from simple model and simple example. *models.py file:* from django.db import models from mezzanine.pages.models import Page class Author(Page): dob = models.DateField(Date of birth) *page_processors.py file:* from django.http import HttpResponseRedirect from mezzanine.pages.page_processors import processor_for from models import Author @processor_for(authors) def authors_list(request, page): authors =['abc', 'def'] //just hard coded these values to get better understanding for myself return {authors: authors} *authors.html page* html head titlePage Title/title /head body {% for item in authors %} {{ item}}br / {% endfor %} /body /html *urls.py file:* url(^authors/$, mezzanine.pages.views.page, {slug: authors}, name=authors), Thank's Mezzanine Users Regards Tameen -- 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 set menus and to get postedata in Mezzanine Django
Hi Kenneth Bolton Thank's for quick response. Few more questions: In the admin interface for the page, look for the fields Show in menus. -*- using admin interface if i create page i don't find this in templates folder and if i create html page and store this in templates/pages folder, how to show this in menu of home page?* using django.http.HttpRequest.methodhttps://www.google.com/url?q=https%3A%2F%2Fdocs.djangoproject.com%2Fen%2Fdev%2Fref%2Frequest-response%2F%23django.http.HttpRequest.methodsa=Dsntz=1usg=AFQjCNF1z6ioCuRXxcKSqGqQiSmPvk2ixw *we return page url so that's work similar to django framework?* Thank's Looking forward to your reply :) Tameen -- 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 set menus and to get postedata in Mezzanine Django
Great reply. Thank's Kenneth Bolton Can i ask you more question's if i face any problems further :) Regards Tameen -- 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 set menus and to get postedata in Mezzanine Django
Great reply. Thank's Kenneth Bolton Can i ask you more question's if i face any problems further :) Regards Tameen -- 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 set menus and to get postedata in Mezzanine Django
yes i studied first 5 chapters of djangobook.com this week. hmm i don't know i just stuck here in mezzanine. Sir can't you give me small example (if you can). Mezzanine documentation is not detailed or may be my mind can't work unless i go through 3,4 examples! :( -- 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: Where to define Proccessor_for.py
and how to define this in template to make this accessible? -- 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.