Re: djangobook.com, chapter 5, __init__() got an unexpected keyword argument 'maxlength'

2013-07-08 Thread Nkansah Rexford
Several years since this question was asked, but really solved my problem today. I'm using 1.5 of django, and the maxlength (now max_length) thing was bugging me. Thanks -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from thi

Django Project/App Folder Hierarchy Ambiguity

2013-07-12 Thread Nkansah Rexford
I'm new to Django, and for the past 2 days, I've been struggling with the ImportError thing until I came across this useful answerthat solved my problem Though its not a bug, can the hierarchy be be

Re: Django Project/App Folder Hierarchy Ambiguity

2013-07-12 Thread Nkansah Rexford
My problem is the one in the question on the site. the Second answer is the solution. I'm using django 1.5.1 My problem is the same as the one on the site -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop

Invalid Syntax - All day long

2013-08-22 Thread Nkansah Rexford
Here's my search app urls.py from django.conf.urls import patterns, url from search import views urlpatterns = patterns('', #url(r'^$', views.search) url(r'^search/$', views.detail) ) Here my project urls.py from django.conf.urls import patterns, include, url urlpatterns = patterns('' url(r

Saving google maps values to db

2013-08-29 Thread Nkansah Rexford
I came across this app for displaying Google maps to pages in django. https://bitbucket.org/dbinit/django-gmapi/src Is there a way I can save Google maps values via a form to db for retrieval later in a page? -- You received this message because you are subscribed to the Google Groups "Django

verify before make changes?

2013-08-31 Thread Nkansah Rexford
def delete_item(request, item_id): item = get_object_or_404(Item, pk=item_id) return render(request, 'delete_item.html', {'item':item, 'item_id':item_id},) def delete_confirmed(request, item_id): query = get_object_or_404(Item, pk=item_id) query.delete()

Flexible For loop

2015-04-03 Thread Nkansah Rexford
allow me to use wired.com to ask my question On wired.com, you see the news items displayed in cards, with varying sizes. In django, using the {% for %} will mean all the news item will have the same card design and size etc. Is there a way in Django to have the design intact, and just filling

Re: Flexible For loop

2015-04-07 Thread Nkansah Rexford
Thanks for pointing out. That's the solution then! -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this gro

Issues downloading documentation offline

2015-04-07 Thread Nkansah Rexford
Downloading offline documentation doesn't work from the djangoproject.com This link: https://docs.djangoproject.com/m/docs/django-docs-1.8-en.zip results in a mere 22bytes size .zip file with no content in the package. Same for the PDF Even this one: http://media.readthedocs.org/pdf/django/1.8.

Re: Issues downloading documentation offline

2015-04-08 Thread Nkansah Rexford
Thanks, Graham -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googl

inlineformset_factory displays only inline formset, doesn't show parent model

2015-04-19 Thread Nkansah Rexford
I have this: # consider all importations done right. def add_noodle(request):NoodleFormSet = inlineformset_factory(Noodle, tutImages, form=NoodleForm, fields=('title', 'image'))if request.method == 'POST':formset = NoodleFormSet(request.POST, request.FILES) if formset.is

Extended pages - wait and render with parent template

2015-07-11 Thread Nkansah Rexford
If template B extends template A, template B renders/parses its content independently before being added to the parent A template. Is there a way to make template B *wait* and render only *after* when added to the parent A template? Independent rendering of extended pages ( same thing happens w

Re: Is there a plan to modernize Django-admin?

2015-07-22 Thread Nkansah Rexford
A relatively new 'suit' in the block might be worth looking into: http://forms.viewflow.io/ I've tried it myself and I think although not complete in its implementation entirely, its a good start too. -- You received this message because you are subscribed to the Google Groups "Django users"

Re: SHOP APP

2015-07-22 Thread Nkansah Rexford
Oh, I thought Google was a friend of us all? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, se

All posts from same day django

2015-07-22 Thread Nkansah Rexford
I currently have: @classmethod def get_past_week(self): start_date = datetime.now().date() end_date = datetime.now().date() - timedelta(weeks=1) return MyModel.objects.filter(pub_date__range=(end_date, start_date )).aggregate(Sum('off_hours')) which simply pulls a

Re: Using git to control the version for an app in my project

2015-07-22 Thread Nkansah Rexford
I couldn't understand your question properly, but I guess you're looking to ignore some parts of your git? Maybe .gitignore file is what you need? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving

Re: All posts from same day django

2015-07-22 Thread Nkansah Rexford
Thanks Carl Also got these approaches too, might help someone too: http://stackoverflow.com/questions/31571607/all-posts-from-same-day-only-django -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receivi

Re: All posts from same day django

2015-07-22 Thread Nkansah Rexford
Yeah, I figured that timezone thing too. Django runs in console with 'naive datetime' bla bla bla all the time without using the timezone -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails f

Allow users to submit django form once per day

2015-07-23 Thread Nkansah Rexford
I want to allow users to submit a django form once, and only once everyday. After submitting the form, the form wouldn't even show (server-side checkings, I don't want to use JS or client side thing; easily 'tamper-able') What is the best way to do so in Django? -- You received this message b

Re: Allow users to submit django form once per day

2015-07-23 Thread Nkansah Rexford
> > You can save the datetime of the last form submission and check whether > its oneday or not in the view. If its one day then show pass the form or > else dont. > > Hope this helps. > I do know I have to save the date stamp, but the question is Where? On the model class, the user class, or

retrieve row with maximum field value django

2015-07-23 Thread Nkansah Rexford
Say I have a model class MyModel(models.Model) name = models.CharField(max_length=20) age = models.IntergerField() How can I find the maximum based on the 'Age' field number and retrieve that whole object? I understand aggregates allows me to find and retrieve the maximum number when gi

Re: retrieve row with maximum field value django

2015-07-24 Thread Nkansah Rexford
order_by('-age').first() > > https://docs.djangoproject.com/en/1.8/ref/models/querysets/#order-by > > Obviously that only pulls the "first" object even if multiple objects have > that same age, so you may need additional filter() and sorting criteria. > &g

Re: Thumbnails In Django

2015-07-24 Thread Nkansah Rexford
Might be unrelated to your specific problem, but generating thumbnails, I do mine in template directly, using ImageKit. Upon upload, I resize the image to a good size or convert the uploaded image to format of my taste, say 2048x1080. Then in template, I just do {% thumbnail '400x500' model.ima

Invalid Syntax. Second pair of eyes might help

2015-07-28 Thread Nkansah Rexford
I have this: class Homepage(FormView): template_name = 'index.html' def get(self, request, *args, **kwargs): ecg_form = GhanaECGForm() ecg_form.prefix = 'ecg_form' last_form = FormLastActiveForm() last_form.prefix = 'last_form' *return self.render

Re: Invalid Syntax. Second pair of eyes might help

2015-07-28 Thread Nkansah Rexford
By the way, i'm following the steps here: http://stackoverflow.com/a/30116519/1757321 I want to have two forms submitted under one submit button. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving

Re: Invalid Syntax. Second pair of eyes might help

2015-07-28 Thread Nkansah Rexford
HOOLY S**T Thanks so much. That was the culprit On Tuesday, July 28, 2015 at 10:39:16 PM UTC, James Schneider wrote: > > It looks like you are trying to pass a dict to get_context_data(), but you > forgot the surrounding {}. > > -James > On Jul 28, 2015 3:36 PM, "Nk

Re: Allow users to submit django form once per day

2015-07-29 Thread Nkansah Rexford
Okay guys, After some days of thinking about the problem, I'm through with this approach, which is totally horrible, I guess, but works. The code snippet can be found here: https://gist.github.com/seanmavley/c9a4af36c2693d9b437a I'm posting back here because although the approach works, its no

Can't access Environment Variables Remote Server Django

2015-08-22 Thread Nkansah Rexford
Although accessible from python, Django can't see my set environment variables. Explained more: http://stackoverflow.com/questions/32158420/cant-access-environment-variables-remote-server-django -- You received this message because you are subscribed to the Google Groups "Django users" group

Re: inlineformset_factory with multiple foreignKeys

2015-10-13 Thread Nkansah Rexford
With multiple inlineformset_factory, Ive not tried, but perhaps this could help: http://stackoverflow.com/questions/3945435/adding-multiple-models-to-inlineformset-factory Mine was just one inlineform -- You received this message because you are subscribed to the Google Groups "Django users"