Back button in a SessionWizardView

2014-02-02 Thread Asad Jibran Ahmed
We had a similar requirement in one of our products. We solved it by assigning the user a unique transaction id when they start the process, and saving all data in a temp db (redis) until the user completed the process. And whenever the user accessed a page with the transaction id in the get par

Re: Send mail after x hours

2016-08-17 Thread Asad Jibran Ahmed
Personally, I'd setup a simple cronjob on my machine that runs a Django management command. The command would get a list of users who are eligible to receive emails and send it to them. I would have just used the send_mail directly from my management command, but if you already have a RQ setup

Re: django on apache server

2016-08-18 Thread Asad Jibran Ahmed
Not being able to load CSS points to an Apache config issue. Did you setup apache so your static root configured to serve files from your static folder? Your apache config might be helpful here. Also, what you have pasted here seems like a warning, so while you should fix it, this is probably n

Re: Models of Speedy Net

2016-08-18 Thread Asad Jibran Ahmed
The ordering of your attributes and methods inside the model class doesn't have to do with Django, it has to do with Python. Inside a class, the ordering doesn't matter as far as I understand. All of these documents you will find are thus just conventions to follow. You could come up with your

Re: Models of Speedy Net

2016-08-18 Thread Asad Jibran Ahmed
t the CONST declaration comes first, it works. On Thursday, August 18, 2016 at 4:08:33 PM UTC+4, Asad Jibran Ahmed wrote: > > The ordering of your attributes and methods inside the model class doesn't > have to do with Django, it has to do with Python. Inside a class, the > or

Re: Running Django Project Locally

2016-08-24 Thread Asad Jibran Ahmed
Hi, It's definitely weird to not have a manage.py since all new Django projects should have it by default. But the manage.py file is pretty simple, and you can just paste this inside a new manage.py: #!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefaul

Re: Running Django Project Locally

2016-08-24 Thread Asad Jibran Ahmed
nd of server running my Django code takes away that ability, and I'd be in hell trying to figure out errors without that. Just my 2 cents. Asad Jibran Ahmed http://blog.asadjb.com On Wed, Aug 24, 2016 at 9:24 PM, Andreas Kuhne wrote: > > 2016-08-24 17:54 GMT+02:00 Michae

Re: is it possible to manipulate image in PIL after uploading directly by its "request.FILES.GETLIST(FORMFIELD)" address not the saved picture on hard disk

2016-08-26 Thread Asad Jibran Ahmed
/uploads/#django.core.files.uploadedfile.UploadedFile Pillow (PIL Fork) documentation for the `frombytes` method: https://pillow.readthedocs.io/en/3.3.x/reference/Image.html#PIL.Image.frombytes Hope that helps. Regards, Asad Jibran Ahmed http://blog.asadjb.com On Fri, Aug 26, 2016 at 7:46 PM, ali

Re: Hi, i'm new to django i need some mini project which contain atleast 4 page for go through how it works

2016-08-29 Thread Asad Jibran Ahmed
You could create a simple blogging application. Allow the user to create, edit, and delete blog posts. And have a list page (home page) to show those posts and a details page for the post. Asad Jibran Ahmed http://blog.asadjb.com On Mon, Aug 29, 2016 at 3:29 PM, rajeshkmr9583 wrote: >

Re: Django template iterating through two dictionaries/variables

2016-08-29 Thread Asad Jibran Ahmed
No need to change the context, since the variable names the example here uses are the same as your existing context. It should work as long as you remember to {% load APPNAME %} your filters in the template first. ​ Asad Jibran Ahmed http://blog.asadjb.com On Mon, Aug 29, 2016 at 6:50 PM, Aaron

Re: Django template iterating through two dictionaries/variables

2016-08-29 Thread Asad Jibran Ahmed
Since the example given by Ludovic uses the same variable names that are already present in your context, you won't need to change anything in the context dictionary. Just use {% load APP_NAME %} on top of the template file to load the filter and you should be good to go. On Monday, August 29,

Re: Django template iterating through two dictionaries/variables

2016-08-29 Thread Asad Jibran Ahmed
or > the correct value in the scores dictionary that has the same Number > identification as the existing person.Number? > > I think what is confusing me is the use of "player" in ludovics example > > Thanks > > Aaron > > On Aug 29, 2016 11:53 AM, "Asad Jib

Re: Django template iterating through two dictionaries/variables

2016-08-29 Thread Asad Jibran Ahmed
Unfortunately without knowing your project layout I can't show you exactly how to load the filters, but you should give this a read: https://docs.djangoproject.com/en/1.10/howto/custom-template-tags/. Your template should look like the example from Ludovic. Asad Jibran Ahmed

Re: multiple django installation in one server

2016-09-07 Thread Asad Jibran Ahmed
hat. Regards, Asad Jibran Ahmed http://blog.asadjb.com On Wed, Sep 7, 2016 at 5:28 PM, miarisoa sandy wrote: > Hi guys, > > I hope you are doing fine. > I have googled it but no fruitful results. > I am a newbie in django and I wonder what is the number maximum django > that

Re: Issue in filtering .....(want to show only the products that are sold and have status of paid in orders App)

2016-09-19 Thread Asad Jibran Ahmed
Hi, While you didn't show us the Product model, I assume it has a ForeignKey to the Order model. To filter for Products that have an Order with a sold status, you should look at the documentation for filtering on relationships at https://docs.djangoproject.com/en/1.10/topics/db/queries/#lookup

Re: Issue in filtering .....(want to show only the products that are sold and have status of paid in orders App)

2016-09-19 Thread Asad Jibran Ahmed
How are you associating a product with an order? Is there a way to get a list of products sold for each order? Asad Jibran Ahmed http://blog.asadjb.com On Tue, Sep 20, 2016 at 9:24 AM, Shamaila Moazzam < shamaila.moaz...@gmail.com> wrote: > Thanks for you kind response ...I am st

Re: Issue in filtering .....(want to show only the products that are sold and have status of paid in orders App)

2016-09-19 Thread Asad Jibran Ahmed
Can you share the Cart model? The Order has a foreign key to Cart. I think that may be the model holding details of the products. On Tuesday, September 20, 2016 at 9:32:12 AM UTC+4, Asad Jibran Ahmed wrote: > > How are you associating a product with an order? Is there a way to get a >

Re: Issue in filtering .....(want to show only the products that are sold and have status of paid in orders App)

2016-09-19 Thread Asad Jibran Ahmed
o.cart.products: products_list.append(p) return products_list This depends on their being a ManyToMany relationship to Product in the Cart model. Asad Jibran Ahmed http://blog.asadjb.com On Tue, Sep 20, 2016 at 10:12 AM, Shamaila Moazzam < shamaila.moaz...@gmail.com> wrote: >

Re: HELP - Writing your first Django app, part 1

2016-10-14 Thread Asad Jibran Ahmed
Just create a new file in whatever text editor you're using (I suggest Sublime Text if you're looking for options) and save the file as urls.py inside the polls directory. Asad Jibran Ahmed http://blog.asadjb.com On Fri, Oct 14, 2016 at 8:00 PM, 'Nick Bansal' via Django

Re: Importing contacts from email/social

2016-10-14 Thread Asad Jibran Ahmed
se sources as well. What's your source? Asad Jibran Ahmed http://blog.asadjb.com On Fri, Oct 14, 2016 at 7:41 PM, M Hashmi wrote: > Hi, > > Is there a library available to import user contact's list? > > If you have some piece of code as reference or a lib pl

Re: HELP - Writing your first Django app, part 1

2016-10-14 Thread Asad Jibran Ahmed
Just save the file inside the *poll *folder. That creates the file. Asad Jibran Ahmed http://blog.asadjb.com On Fri, Oct 14, 2016 at 9:55 PM, 'Nick Bansal' via Django users < django-users@googlegroups.com> wrote: > I tried to create a new file (im using sublime text) bu

Re: Importing contacts from email/social

2016-10-14 Thread Asad Jibran Ahmed
Thanks! It's nice to hear my book is useful to someone out there! :) Back to your question, have you tried this: https://github.com/mengu/django_contact_importer Asad Jibran Ahmed http://blog.asadjb.com On Sat, Oct 15, 2016 at 2:25 AM, M Hashmi wrote: > > I was hoping to fin

Re: How to use Django forms for surveys

2016-10-17 Thread Asad Jibran Ahmed
you seem to indicate there is more complicated logic involved than just the simple "Only show this question if that question had and answer matching X". But this is a reasonable starting point for something like this. As you develop your application further you'll learn much more abo

Re: Compiling/packing Django to one binary

2016-10-18 Thread Asad Jibran Ahmed
that jumps to my mind for something like this. Is that a possibility that you can consider? If not, then I'm sure there will be better answers to your question from other people in this group. Regards, Asad Jibran Ahmed http://blog.asadjb.com On Tue, Oct 18, 2016 at 10:45 PM, Александр Х

Re: Multiple Types of Account with Abstract User

2016-10-23 Thread Asad Jibran Ahmed
might work for you. Otherwise you'll have to remove your existing database and run migrations from start. Asad Jibran Ahmed http://blog.asadjb.com On Mon, Oct 24, 2016 at 4:37 AM, Shazia Nusrat wrote: > Hi, > I am trying to create multiple types of users in my django e-commerce &g

Re: Multiple Types of Account with Abstract User

2016-10-23 Thread Asad Jibran Ahmed
e key. This is similar to what you're doing with your UserDetails models. Hope that helps. Asad Jibran Ahmed http://blog.asadjb.com On Mon, Oct 24, 2016 at 7:18 AM, Shazia Nusrat wrote: > I've deleted DB and migrations I had previously. > But still can't figure this out. What

Re: Methods in Models

2016-10-24 Thread Asad Jibran Ahmed
guidelines. Asad Jibran Ahmed http://blog.asadjb.com On Mon, Oct 24, 2016 at 11:47 AM, Deep Shah wrote: > What kind of methods should be part of the models and what should be in > the views? Can anyone give me an example of a method which should be in a > Model than the views file? >

Re: Help with runserver

2016-11-19 Thread Asad Jibran Ahmed
Do you have debugging turned on (DEBUG=True in settings.py) in Django? If you do, you should see a pretty detailed stack trace and not just this. Also, in the console you should see a stack trace with the details of the error. Do you see those? Asad Jibran Ahmed http://blog.asadjb.com On Sun

Re: Trying to print data containing a space in html

2017-01-09 Thread Asad Jibran Ahmed
Hi Anjali, Where inside your project are you storing the nbsp.py file? Regards, Asad Jibran Ahmed http://blog.asadjb.com On Tue, Jan 10, 2017 at 11:09 AM, wrote: > I have a data attached with multiple spaces, I want to print the data on > html page along with spaces but in html spac

Re: Trying to print data containing a space in html

2017-01-10 Thread Asad Jibran Ahmed
Can you try moving the templatetags directory to be underneath the webpage directory. I think that templatetags should be a part of an app. Right now your templatetags are under the mysite folder, which if I'm not wrong isn't considered an app. Regards, Asad Jibran Ahmed http://blog.