Problem installing django on windows

2007-09-11 Thread Dean

Hi
I'm having trouble getting jdango working on windows XP.
I've been following the tutorial on:http://thinkhole.org/wp/django-on-
windows/
I have installed all the latest versions of progams that are mentioned
in the tutorial.
but have trouble getting the demo page to work.

I get to this part:

C:\Documents and Settings\HP_Administrator>cd C:\

C:\>cd django

C:\django>django-admin.py startproject testproject

C:\django>cd testproject

C:\django\testproject>python manage.py runserver


but then I get an error saying:

'python' is not recognized as an internal or external command,
operable program or batch file.
C:\django\testproject>

Any help appreciated
Thanks, Dean


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Lookup Fields

2014-07-05 Thread Dean


> LOOKUP_PEOPLE = (
> ('person1', 'person1'),
> ('person2', 'person2'),
> ('person3', 'person3'),
> ) 
>
role_for_who = models.CharField('Role for', max_length=50, 
> choices=LOOKUP_PEOPLE)
>

Thanks in advance for any help. I almost had it - I wish - but don't think 
django liked starting with an empty database.

When defining the models.py, rather than use a handtyped LOOKUP_PEOPLE (as 
above) I would like LOOKUP_PEOPLE to provide the choices from a list of 
forenames. How do I do that, when the forenames are in the same 'class 
People'?
(I understand I won't see these in the models.py file).

Thanks again.


-- 
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@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3d80243b-a949-4535-8fd1-90f45c938fd8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django 1.6 + Mysql

2014-07-05 Thread Dean
The first place I look is in the last line of the error message. I don't 
think you have a MySQL connection, check in your error log file.


On Sunday, July 6, 2014 8:03:56 AM UTC+8, Henrique Oliveira wrote:
>
> hi there,
>
> I am getting this error when using Mysql connector:
>
> File "/opt/b360/lib/python3.4/site-packages/django/core/handlers/base.py", 
> line 114, in get_response
> response = wrapped_callback(request, *callback_args, **callback_kwargs)
>
>   File 
> "/opt/b360/lib/python3.4/site-packages/django/views/generic/base.py", line 
> 69, in view
> return self.dispatch(request, *args, **kwargs)
>
>   File 
> "/opt/b360/lib/python3.4/site-packages/django/views/generic/base.py", line 
> 87, in dispatch
> return handler(request, *args, **kwargs)
>
>   File "/opt/b360/lib/python3.4/site-packages/allauth/account/views.py", 
> line 194, in get
> self.object = self.get_object()
>
>   File "/opt/b360/lib/python3.4/site-packages/allauth/account/views.py", 
> line 258, in get_object
> return queryset.get(key=self.kwargs["key"].lower())
>
>   File "/opt/b360/lib/python3.4/site-packages/django/db/models/query.py", 
> line 301, in get
> num = len(clone)
>
>   File "/opt/b360/lib/python3.4/site-packages/django/db/models/query.py", 
> line 77, in __len__
> self._fetch_all()
>
>   File "/opt/b360/lib/python3.4/site-packages/django/db/models/query.py", 
> line 854, in _fetch_all
> self._result_cache = list(self.iterator())
>
>   File "/opt/b360/lib/python3.4/site-packages/django/db/models/query.py", 
> line 220, in iterator
> for row in compiler.results_iter():
>
>   File 
> "/opt/b360/lib/python3.4/site-packages/django/db/models/sql/compiler.py", 
> line 709, in results_iter
> for rows in self.execute_sql(MULTI):
>
>   File 
> "/opt/b360/lib/python3.4/site-packages/django/db/models/sql/compiler.py", 
> line 772, in execute_sql
> sql, params = self.as_sql()
>
>   File 
> "/opt/b360/lib/python3.4/site-packages/django/db/models/sql/compiler.py", 
> line 93, in as_sql
> where, w_params = self.query.where.as_sql(qn=qn, 
> connection=self.connection)
>
>   File 
> "/opt/b360/lib/python3.4/site-packages/django/db/models/sql/where.py", line 
> 103, in as_sql
> sql, params = child.as_sql(qn=qn, connection=connection)
>
>   File 
> "/opt/b360/lib/python3.4/site-packages/django/db/models/sql/where.py", line 
> 106, in as_sql
> sql, params = self.make_atom(child, qn, connection)
>
>   File 
> "/opt/b360/lib/python3.4/site-packages/django/db/models/sql/where.py", line 
> 181, in make_atom
> lvalue, params = lvalue.process(lookup_type, params_or_value, 
> connection)
>
>   File 
> "/opt/b360/lib/python3.4/site-packages/django/db/models/sql/where.py", line 
> 365, in process
> connection=connection, prepared=True)
>
>   File 
> "/opt/b360/lib/python3.4/site-packages/django/db/models/fields/__init__.py", 
> line 407, in get_db_prep_lookup
> prepared=prepared)]
>
>   File 
> "/opt/b360/lib/python3.4/site-packages/django/db/models/fields/__init__.py", 
> line 912, in get_db_prep_value
> return connection.ops.value_to_db_datetime(value)
>
>   File 
> "/opt/b360/lib/python3.4/site-packages/mysql/connector/django/base.py", 
> line 398, in value_to_db_datetime
> return self.connection.connection.converter._datetime_to_mysql(value)
>
> AttributeError: 'NoneType' object has no attribute 'converter'
>
> Any Ideas?
>

-- 
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@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e0bff0f9-ff81-40c6-a239-d41bf785725b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: models

2014-07-05 Thread Dean
You could start here http://www.djangobook.com/en/2.0/chapter05.html and 
look at a 1/3 down the page at the heading 'Your First Model'.

Taking 'events' as an example, think about the data you need to record. For 
example, each event normally has a title, location, start date and time, 
end date and time and perhaps a link to the promoters main website, where 
the event is featured. As a rough example:

class NgangsiaEvent(models.Model):
title = models.CharField(max_length=100)
location = models.CharField(max_length=75)
starting = models.DateTimeField(auto_now=False, auto_now_add=False)
it_ending = = models.DateTimeField(auto_now=False, auto_now_add=False)
website = models.URLField()


Hope that helps!

On Saturday, June 28, 2014 5:22:30 PM UTC+8, ngangsia akumbo wrote:
>
> please what can go within these models
>
> page, events, news,  offers,  room types, services
>

-- 
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@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d25c7d02-505b-41cc-ac55-d2b64a5bcb71%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: DateTimeField always returns None

2014-07-05 Thread Dean
I think there is a restriction in using 'date' in MySQL as a field name as 
it's some sort of inbuilt function. 

On Friday, July 4, 2014 5:01:15 PM UTC+8, William Granli wrote:
>
> I am trying to create a queryset for getting the values of a DateTimeField 
> which is DATETIME in the DB.
>
> The class in models.py:
>
> class ChangeMetrics(models.Model):
> id = models.IntegerField(primary_key=True)
> file_id = models.ForeignKey(File, db_column = 'file_id')
> version_id = models.ForeignKey(Version, db_column = 'version_id')
> function_id = models.ForeignKey(Function, blank=True, db_column = 
> 'function_id')
> date = models.DateTimeField(blank=True, null=True)
> user = models.TextField(blank=True)
> changed = models.IntegerField(blank=True, null=True)
>
> The field in the SQL DB:
>
> date DATETIME
>
> The tuples are populated in the database and running SQL queries directly 
> on the DB is working perfectly.
>
> This is the queryset I am currently using in Django:
>
> queryset = ChangeMetrics.objects.filter(~Q(changed=None), ~Q(date=None), 
> ~Q(version_id=None))
>
> I have tried a raw query and also a version of the query that uses 
> exclude(), but that still returns None for date.
>
> I am accessing the entries in the queryset through a for loop and simply 
> accessing date through entry.date inside the for loop.
>
> I am using Django version 1.6.5. I have also tried getting the values 
> through the Django shell, to no success.
>
> Any ideas on what could be wrong? I have tried a multitude of queries, 
> none of them change the returned value of date. I have tried resyncing the 
> DB. I've looked over the models and everything seems to be correct. 
> Everything except the date works fine.
>

-- 
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@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/20994464-f99b-40bf-a16e-aaff87ff9d5a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Lookup Fields

2014-07-06 Thread Dean
Spot on DR - thanks - for pointing me in the right direction :-)


  

 

-- 
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@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a1d6e0e6-3597-4e73-b1f9-69a00c0a84b4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Tango with Django chapter 7 Exercises

2014-07-06 Thread Dean
When changing the model, it can help to drop the relevant tables in the db 
and sync. It kinda flushes things out. That's what I'm finding anyway :-/ 
I'm only a chapter 5 guru atm, so apologies for my probably unhelpful 
comments. Maybe you need to restart your server too - have you tried 
turning it off and on again? :-) Just trying to cure the headache!

Dean

On Monday, July 7, 2014 3:02:32 AM UTC+8, Martin Spasov wrote:
>
> I am doing the exercises in chapter 7 
> <http://www.tangowithdjango.com/book/chapters/forms.html#exercises> and I 
> have to create an add page link on every category page that would take the 
> users to a new page on which they can enter name and url to add to certain 
> category if the category in question is not existing they would be 
> redirected to the add category page.
>
> so the steps are:
>
> 1.Create a new view (the tut gives us this one ready)
>
> def add_page(request, category_name_url):
> context = RequestContext(request)
> category_name = category_name_url.replace('_',' ')
> if request.method == 'POST':
> form = PageForm(request.POST)
>
> if form.is_valid():
> page = form.save(commit = False)
>
> try:
> cat = Category.objects.get(name = category_name)
> page.category = cat
> except Category.DoesNotExist:
> return render_to_response('blog/add_category.html', {} , 
> context)
>
> page.views = 0
> page.save()
>
> return category(request, category_name_url)
> else:
> print form.errors
>
>else:
> form = PageForm()
>
> return render_to_response('blog/add_page.html', {'category_name_url': 
> category_name_url, 'category_name': category_name, 'form': form}, context)
>
> 2.create a new template
>
> 
> 
> 
>  Drib 
> 
>
> 
> Add Page
>
> 
> {% csrf_token %}
> {%for hidden in forms.hidden_fields%}
> {{hidden}}
> {%for field in forms.visible_fields%}
> {{field}}
> {{field.errors}}
> {{field.help_text}}
> 
> 
> 
>
> 
>
> 3.URL Mapping
>
> url(r'^category/(?P\w+)/add_page/$', views.add_page , name 
> = 'add_page')
>
> 4.Create a link from the category page (I am just going to post the link 
> because there is no point to post the whole file...
>
>  Add Page
>
> Hints from the tut are :
>
> -Update the category() view to pass category_name_url by inserting it to 
> the view’s context_dict dictionary - DONE
>
> -Update the category.html with a link to /rango/category//add_page/. 
> Ensure that the link only appears when the requested category exists - with 
> or without pages. - I believe i did that in step 4 (not 100 % sure though)
>
> -Update rango/urls.py with a URL mapping to handle the above link.(Step 3 
> i believe)
>
>
> My question is why when clicking on add page and entering the details 
> needed it doesnt add the page at all its not even doing the is_valid() i 
> believe because the same function works perfectly when creating 
> categories(i get a message if the cat is already created or if i leave it 
> blank) but here it just redirects me and thats 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, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a13f6dcc-9d5e-450b-8bfd-3bea637a9733%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Application Generators Comparison and Benefits list

2014-07-07 Thread Dean
No time for that, too busy... tortured and overwhelmed! :-/

On Tuesday, July 8, 2014 5:32:58 AM UTC+8, Dan Cancro wrote:
>
> Hi group,
>
> I made this comparison of things for starting a web application with 
> AngularJS and thought I would check here to see if a similar analysis had 
> taken place for Django application generators.
>
> http://dancancro.com/comparison-of-angularjs-application-starters/
>
> My goal is to clarify the similarities, strengths and weaknesses of the 
> options. In so doing, I hope that people will see how it makes more sense 
> to join forces on a single, great application generator instead of 
> competing against each other, duplicating work, and torturing overwhelmed 
> users by having many separate projects.
>
> So, two questions:
> 1) Do you know of any such comparison of things for making Django apps?
> 2) Can you think of any additions to the list of attributes or benefits in 
> the first column?  It does have some AngularJS specific stuff, but it is 
> meant to be as technology neutral as possible.
>
> Thanks,
> Dan
>

-- 
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@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e974ca11-4cbb-4c76-89de-3ce949ed082a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Problem installing django on windows

2007-09-11 Thread Dean Edridge

Ahik wrote:
> Hi,
> It seems that 'python' is not in your path.
>
> Try to locate the the path for python.exe. It might be something like:
> C:\Python25\python.exe
> In this case you can type the following:
> C:\django\testproject>C:\Python25\python.exe manage.py runserver
> It should work.
>
> Later, you can add the python path (C:\Python25 in the above example)
> to your environment.
>
> Ahik
>
> On Sep 12, 7:12 am, Dean <[EMAIL PROTECTED]> wrote:
>   
>> Hi
>> I'm having trouble getting jdango working on windows XP.
>> I've been following the tutorial on:http://thinkhole.org/wp/django-on-
>> windows/
>> I have installed all the latest versions of progams that are mentioned
>> in the tutorial.
>> but have trouble getting the demo page to work.
>>
>> I get to this part:
>>
>> C:\Documents and Settings\HP_Administrator>cd C:\
>>
>> C:\>cd django
>>
>> C:\django>django-admin.py startproject testproject
>>
>> C:\django>cd testproject
>>
>> C:\django\testproject>python manage.py runserver
>>
>> but then I get an error saying:
>>
>> 'python' is not recognized as an internal or external command,
>> operable program or batch file.
>> C:\django\testproject>
>>
>> Any help appreciated
>> Thanks, Dean
>> 
Thanks a lot Ahik. That worked.
Thanks very much.

Regards, Dean

-- 
Dean Edridge
http://www.zealmedia.co.nz/


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Use .html at the end of the url instead of / ?

2007-10-17 Thread Dean Edridge

Mathieu Poussin wrote:
> Hello ,
> i have a question,
> by default , django add a slash at the end of the url , like that :
> http://my/documents/hello -> http://my/documents/hello/
>
> it's possible to add .html instead of that ? like that :
> http://my/documents/hello -> http://my/documents/hello.html
>
> if yes, how ?
>
>
> thanks , Sorry for my bad english
Hi Mathieu,

Are you sure you want to change your URLs to .html?

Personally, I think that all URLs should end with a slash, most good SEO 
specialists choose this style.

Having your URLs end with a slash is good. It looks better and shortens 
your pages address. Also, in the future, you may find that not all of 
your pages are going to be text/html.

I'm just a django newbie but I would say that you might get into trouble 
later if you ad .html to the end of all your URLs. For example what 
would happen if you wanted to have a sub-page/child-page(s) such as 
http://my/documents/hello/world/ or 
http://my/documents/hello/there/how-are-you/  If you had a page called 
http://my/documents/hello.html it wouldn't really make sense.

I think having URLs end with a slash gives you more options in the 
future, but that's just my opinion :)

Thanks,
Hope that helps,

-- 
Dean Edridge
http://www.zealmedia.co.nz/


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: to login or not to login, that is the question

2006-09-10 Thread Dean Nevins

You should just use the Django auth system. It's fairly easy to use and
it provides mechanisms for protecting views that you would have to
duplicate anyway. If the default User object is too skimpy for you, you
can add to it using UserProfiles or just create a table and link to the
User.

BTW, I'm using Django for the classes that I teach. I've got three
classes running on one Django site as subdomains using the "sites"
framework.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Newtwork Marketing System

2023-06-20 Thread Dean Mahori
Hi anyone to teach me forex trading guys...


On Thu, 15 Jun 2023, 11:36 Benjamin Schollnick, 
wrote:

> Hi Everyone!
> So I want to know how to implement a binary tree to a web app.
> This is how the app works:
>
> —  Person A opens an account
> —  Person A refers to people
> — Person B invests,
> — Person A get 10% of Person B's investment
> So it goes on iteratively.
>
>
> Please note, nothing here in your description *needs* (or begs) to be a
> binary tree.
>
> Have a referred field in the person table, which points to the PK of the
> person that referred them.
>
> Then you just do a filter on that persons referred field PK to find out
> who referred them.
>
> Yes, a binary tree is suppose to be one of the faster searches for certain
> types of data…But as described I’m not sure it’s a good fit.
>
> - Benjamin
>
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/96D0264D-3922-4376-8334-7D11CFFA9456%40schollnick.net
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAOxCe%3DTzQTyU_Bo9etb2F_RQYzF8T%3DiPgGrE7yU4YmPZ%3DF3hsg%40mail.gmail.com.


Django Form Doesn't Render

2011-02-14 Thread Dean Chester
Hi,
I have written a form in forms.py that looks like this:
class ContractForm(forms.Form):
title = forms.CharField()
start_date = forms.DateField()
end_date = forms.DateField()
description = forms.CharField(widget=forms.Textarea)
client = forms.ModelChoiceField(queryset=Client.objects.all())

And in my view (yes i know there are problems with data not being
checked but the aim was to get the client field to display clients
associated with that user):
def addContractTEST(request):
if request.method == 'POST':
contractForm = ContractForm(request.POST)
title = request.POST['title']
start_date = request.POST['start_date']
end_date = request.POST['end_date']
description = request.POST['description']
client = request.POST['client']
user = request.user
contract =
Contract(title,start_date,end_date,description,client,user)
contract.save()
return HttpResponseRedirect('../../accounts/profile/')
else:
user = request.user
print user.username
contractForm = ContractForm()
return render_to_response('newcontract.html', {'ContractForm':
ContractForm})

And my newcontract.html:

 


{% if contractForm.errors %}

Please correct the error{{ contractForm.errors|pluralize }} 
below.

{% endif %}


{{ contractForm.as_p }}



  

But all that appears is my submit button so what am I doing wrong?

Thanks in Advance,
Dean

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: django.contrib.auth.views.login customization

2011-02-16 Thread Dean Chester
I would write my own login controller using the Authentication and Login 
methods. Check out this part of the django docs: 
http://docs.djangoproject.com/en/1.2/topics/auth/#how-to-log-a-user-in

Dean 
On 16 Feb 2011, at 13:51, galago wrote:

> Is it possible, to add some extra validation checks into 
> django.contrib.auth.views.login?
> I need to check some fields from UserProfile to login
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



geo data fixture with loaddata, YAML

2014-07-07 Thread Ben Dean
Hi, 

I wanted to cross post this here from the original 
 on the 
geodjango group. I let the details stand there, but summarize here:

Trying to use manage.py loaddata to get a YAML fixture containing a 
geoDjango "MultiPolygonField", but I am running into some problem with the 
serialization format:
*Cannot set Neighborhood GeometryProxy (MULTIPOLYGON) with value of type: 
*
or
*Cannot set Neighborhood GeometryProxy (MULTIPOLYGON) with value of type: 
*

Hoping someone with more YAML/loaddata expertise can point me in the right 
direction vis. this formatting problem

-- 
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@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b3b2bdf4-e011-42f1-931b-72b0cbd36ed1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


GeoDjango/PostGIS installation issues

2014-06-27 Thread Ben Dean
I'm stymied on installing GeoDjango with Postgres9.3 on Ubuntu. I've posted 
the details here 
,
 
so any help would be appreciated and I can promise you all the internet 
points I'm capable of distributing!

-- 
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@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5699b73e-6780-4750-a9c5-6b55ecb96a56%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django Admin Form clean method override only working for one exception

2018-01-04 Thread dean raemaekers
Hello,

I am trying to override the Forms in the Django Admin interface to have 
custom exceptions in the clean() method.

This works for my first validation, but it doesn't work for a second one in 
the same form, or on another form at all. I am wondering if I have the 
syntax wrong for multiple validations.

The code looks like this:

class ProviderForm(forms.ModelForm):
class Meta:
model = Provider
fields = '__all__'

def clean(self):
#provider start date and end date
provider_start_date = self.cleaned_data.get('provider_start_date')
provider_end_date = self.cleaned_data.get('provider_end_date')
if provider_start_date > provider_end_date:
raise forms.ValidationError("Start date can't be after end date")

#etqe_id and provider_code
provider_etqe_id = self.cleaned_data.get('provider_etqe_id')
provider_code = self.cleaned_data.get('provider_code')
if "HW" not in provider_code:
raise forms.ValidationError("Invalid provider code")

if "9" not in provider_etqe_id:
raise forms.ValidationError("Invalid ETQE ID") 

return self.cleaned_data

class ProviderAdmin(admin.ModelAdmin):
form = ProviderForm

admin.site.register(Provider, ProviderAdmin)

(The first validation, the start date and end date, does work perfectly - 
the second validation does not work at all, and allows the form to be saved 
no matter what data is entered)

Then I also have replicated this for another form:

class PersonForm(forms.ModelForm):
class Meta:
model = Person
fields = '__all__'

def clean(self):

person_alternate_id = self.cleaned_data.get('person_alternate_id')
alternate_id_type_id = self.cleaned_data.get('alternate_id_type_id') 

if person_alternate_id is not None and alternate_id_type_id == 533:
raise forms.ValidationError("Person Alternate ID is not blank, therefore 
Alternate ID Type ID cannot be 533")
if person_alternate_id is None and alternate_id_type_id != 533:
raise forms.ValidationError("Person Alternate ID is blank, therefore 
Alternate ID Type ID must be 533")

return self.cleaned_data

class PersonAdmin(admin.ModelAdmin):
form = PersonForm

admin.site.register(Person, PersonAdmin)

This does not work at all, and also allows the form to be saved even if the 
invalid data has been entered.

Thanks in advance!

-- 
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@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6d1e21bc-cc16-42bd-a9b9-949a800c81b7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Admin Form clean method override only working for one exception

2018-01-04 Thread dean raemaekers
Thanks Julio!

This worked.

On Thursday, January 4, 2018 at 2:59:16 PM UTC+2, Julio Biason wrote:
>
> Hi Dean,
>
> You forgot to call the form clean method (the first line after your `def 
> clean` should be `super().clean()` as shown in the documentation: 
> https://docs.djangoproject.com/en/2.0/ref/forms/validation/#cleaning-and-validating-fields-that-depend-on-each-other
> ).
>
> On Thu, Jan 4, 2018 at 7:06 AM, dean raemaekers  > wrote:
>
>> Hello,
>>
>> I am trying to override the Forms in the Django Admin interface to have 
>> custom exceptions in the clean() method.
>>
>> This works for my first validation, but it doesn't work for a second one 
>> in the same form, or on another form at all. I am wondering if I have the 
>> syntax wrong for multiple validations.
>>
>> The code looks like this:
>>
>> class ProviderForm(forms.ModelForm):
>> class Meta:
>> model = Provider
>> fields = '__all__'
>>
>> def clean(self):
>> #provider start date and end date
>> provider_start_date = self.cleaned_data.get('provider_start_date')
>> provider_end_date = self.cleaned_data.get('provider_end_date')
>> if provider_start_date > provider_end_date:
>> raise forms.ValidationError("Start date can't be after end date")
>>
>> #etqe_id and provider_code
>> provider_etqe_id = self.cleaned_data.get('provider_etqe_id')
>> provider_code = self.cleaned_data.get('provider_code')
>> if "HW" not in provider_code:
>> raise forms.ValidationError("Invalid provider code")
>>
>> if "9" not in provider_etqe_id:
>> raise forms.ValidationError("Invalid ETQE ID") 
>>
>> return self.cleaned_data
>>
>> class ProviderAdmin(admin.ModelAdmin):
>> form = ProviderForm
>>
>> admin.site.register(Provider, ProviderAdmin)
>>
>> (The first validation, the start date and end date, does work perfectly - 
>> the second validation does not work at all, and allows the form to be saved 
>> no matter what data is entered)
>>
>> Then I also have replicated this for another form:
>>
>> class PersonForm(forms.ModelForm):
>> class Meta:
>> model = Person
>> fields = '__all__'
>>
>> def clean(self):
>>
>> person_alternate_id = self.cleaned_data.get('person_alternate_id')
>> alternate_id_type_id = self.cleaned_data.get('alternate_id_type_id') 
>>
>> if person_alternate_id is not None and alternate_id_type_id == 533:
>> raise forms.ValidationError("Person Alternate ID is not blank, therefore 
>> Alternate ID Type ID cannot be 533")
>> if person_alternate_id is None and alternate_id_type_id != 533:
>> raise forms.ValidationError("Person Alternate ID is blank, therefore 
>> Alternate ID Type ID must be 533")
>>
>> return self.cleaned_data
>>
>> class PersonAdmin(admin.ModelAdmin):
>> form = PersonForm
>>
>> admin.site.register(Person, PersonAdmin)
>>
>> This does not work at all, and also allows the form to be saved even if 
>> the invalid data has been entered.
>>
>> Thanks in advance!
>>
>> -- 
>> 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...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/6d1e21bc-cc16-42bd-a9b9-949a800c81b7%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/6d1e21bc-cc16-42bd-a9b9-949a800c81b7%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> *Julio Biason*, Sofware Engineer
> *AZION*  |  Deliver. Accelerate. Protect.
> Office: +55 51 3083 8101  |  Mobile: +55 51 *99907 0554*
>

-- 
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@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4cf452a6-1232-43d6-9ae0-1ddd310db98e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


ModelForm for model that includes multiple items of one kind

2019-03-30 Thread Dean Karres
Hi

I am looking for some advice.  I have a basic Profile model.  It looks 
something like:

Profile:
first_name
middle_name
last_name
birthday
address_line1
address_line2
city
state
zip
email
phone

I have a ModelForm that goes with this.

This is sufficient for nearly all the cases I am trying to deal with.  
However, there are a few special cases in which a person needs to list two 
or more addresses; two or more email addrs; two or more phone numbers; or, 
combinations.  

I know just enough about database normalization to think that I need the 
Profile model plus Address, Email and Phone models and have the Profile 
have a ForeignKey relation to each of the others.  A la:

Profile:
first_name
middle_name
last_name
birthday




Address
address_line1
address_line2
City
state
zip

Email
email

Phone
phone

My question is more about the associated ModelForm(s).  First, I currently 
have a ModelForm for the first Profile model without the foreign keys.  If 
I break out the address, email and phone portions into separate models do I 
need to create separate model forms for each new model?  If so would the 
new Profile ModelFOrm just inherit the ModelForms of the other components. 
Something like:

class ProfileForm(ModelForm, AddressForm, EmailForm, PhoneForm):
...

The current ModelForm has "clean_" "clean" methods.  Do I keep that 
in the new Profile form?  Do I put the various "clean" methods in their own 
model forms and hope that inheritance will pull them in?

Next, how does a ModelForm deal with more than one of the same item -- like 
more then one address?

-- 
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@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a8954cd8-e3c6-4d6f-8780-1f88a9874a3b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ModelForm for model that includes multiple items of one kind

2019-03-30 Thread Dean Karres
Thanks to the responders. I was unaware of formsets / midelformsets.  I am
reading about them now.

Cheers

-- 
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@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO%2B1Q_tBioOyfwFKBQKPEX27n6wSo2W9Q0d3PZwJWEy-iizKWA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Update using columns from subquery

2019-06-21 Thread Dean Rabinowitz
I'm new to the community (this is my first topic here) so I apologize if 
I'm breaking any rules with this post.

My goal is to update a table in my Postgres db using the values from a 
queryset only where some of the values are equal to the columns in my 
table. Essentially, I'd like to do the following:

UPDATE schema.table t1 SET t1.value = t2.value FROM ( SELECT id1, id2, value 
FROM 
does_not_matter ) t2 WHERE t1.id1 = t2.id1 AND t1.id2 = t2.id2 In this 
example, t2 represents my queryset. It can contain potentially hundreds of 
thousands of rows (distinct on (id1, id2)).

Is there any way to accomplish this using the django ORM? I'm using version 
1.11

-- 
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@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a2ca8f74-cc05-41c7-bee9-4f981ead3538%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


New user question: Where to put non-form validation code?

2019-07-13 Thread Dean Karres
Hi,

I am learning Django.  I am using CBVs.  My default "index.py" view is 
basically a dashboard for the app I am playing with.  As my models and 
views become more complicated I want to be able to ask, for any model 
instance, is this instance "valid" or "complete".  Valid means that all 
Required elements are present and have reasonable values.  "Complete" means 
that an instance is "valid" but also some specific bits of additional info 
are also ok.

For example I have a Student model that has name and address info.  There 
is a ManyToMany relation to the Class(es) in which that Student is 
enrolled.  A "student" instance is valid if the name and address fields are 
filled.  A student is "complete" if the student is valid and has signed up 
for one or more classes.

So, my question is: where should the valid and complete methods live?  
Should they be in the Student model or CBV?  Someplace else?  Does it 
matter?

Cheers

-- 
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@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/22801669-96ec-4a43-a264-fd50c2544604%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: New user question: Where to put non-form validation code?

2019-07-13 Thread Dean Karres
Thank you. There are way more parts to this than I would have imagined.



On Sat, Jul 13, 2019, 8:01 PM Mike Dewhirst  wrote:

> On 14/07/2019 10:37 am, Dean Karres wrote:
>
> Hi,
>
> I am learning Django.  I am using CBVs.  My default "index.py" view is
> basically a dashboard for the app I am playing with.  As my models and
> views become more complicated I want to be able to ask, for any model
> instance, is this instance "valid" or "complete".  Valid means that all
> Required elements are present and have reasonable values.  "Complete" means
> that an instance is "valid" but also some specific bits of additional info
> are also ok.
>
> For example I have a Student model that has name and address info.  There
> is a ManyToMany relation to the Class(es) in which that Student is
> enrolled.  A "student" instance is valid if the name and address fields are
> filled.  A student is "complete" if the student is valid and has signed up
> for one or more classes.
>
> So, my question is: where should the valid and complete methods live?
> Should they be in the Student model or CBV?  Someplace else?  Does it
> matter?
>
>
> I like to put that sort of stuff into model methods then add model.clean()
> to call them and raise whatever error may be appropriate if they fail.
>
>
> https://docs.djangoproject.com/en/2.1/topics/forms/modelforms/#interaction-with-model-validation
>
> and
>
>
> https://docs.djangoproject.com/en/2.1/ref/models/instances/#validating-objects
>
> and
>
>
> https://docs.djangoproject.com/en/2.1/ref/models/instances/#django.db.models.Model.clean
>
> You can raise your own errors which inherit from ValidationError to fine
> tune the process. For example, I differentiate between
> BusinessRuleViolation and InvalidToken and a couple of others where that
> delivers better control.
>
>
>
> Cheers
> --
> 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@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/22801669-96ec-4a43-a264-fd50c2544604%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/22801669-96ec-4a43-a264-fd50c2544604%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
>

-- 
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@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO%2B1Q_uv_PN%3Dm8Ny5zWyQVGbSkY2mnwZJO-dYQy2yL8CbOTgsw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


how do I use the url to filter?

2016-02-01 Thread Dean Johnson
Hello all,

Hopefully someone can shed some light on this for me..

I have been following a blog tutorial, just to get used to Django, and how 
everything works with url/views/models etc...

but I have become stuck.

So I am able to go to the admin panel and create,save "blogs", when I visit 
http://127.0.0.1:8000/blogs - the page shows a title, name and date of 
several test blogs that have been created, with the header(title) of the 
blog being a link, that takes me to the blog ID page e 
http://127.0.0.1:8000/3

in my c:\mysite\blog\urls.py

from django.conf.urls import url, include
from django.views.generic import ListView, DetailView
from blog.models import Post

urlpatterns =[
url(r'^$', 
ListView.as_view(queryset=Post.objects.all().order_by("-date")[:25], 
template_name="blog/blog.html")),
 url(r'^(\d{1,2})/$', 
ListView.as_view(queryset=Post.objects.all().order_by("id")[:1], 
template_name="blog/blogpost.html")),  
 ]


As you can probably tell I copied and pasted the first url, for the second 
one and edited it, This is where I need help!, I can't find anything over 
the internet that I can fully understand, or guides/tutorials have done it 
completely different to the point I would have to backtrack and edit loads 
of stuff. 

so how can I make it, if http://127.0.0.1:8000/blog/1 has been clicked it 
only shows blog entry 1, or if /blog/2 it shows entry 2 etc etc 

many thanks everyone. 

-- 
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@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/39bcac39-3d06-4796-878c-5051f20375f4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django admin panel records disappearing

2018-07-23 Thread dean raemaekers
Hello,

I am using the Django admin tool as an internal tool to reach into a remote 
database.

Most of my models work perfectly with the save. method additions I have 
added, but there are 2 that are not working.

What happens is that the admin screen gives a successful "save" message, 
but the grid view doesn't show any records.

When I click on the entry in the right hand "Recent changes" list, it says:

Change learner batch back to draft with ID "None" doesn't exist. Perhaps it 
was deleted?

Any advice on why this is happening would be welcome :)

Here is the model in question:

class ChangeLearnerBatchBackToDraft(models.Model):
ticket_number = models.CharField(max_length=10, default='')
provider_accreditation_num = models.CharField(max_length=30)
batch_id = models.CharField(max_length=30)
notes_log = models.TextField(default="No notes added", editable=False)

def save(self, *args, **kwargs): 
try:
commando_conn = psycopg2.connect(f"dbname='{DB}' user='{USER}' host='{HOST}' 
password='{PASS}'")
commando_cur = commando_conn.cursor()
commando_cur.execute(f"select * from res_partner where 
provider_accreditation_num='{self.provider_accreditation_num}';") 
res = commando_cur.fetchone()
real_provider_id = res[0]
self.notes_log = self.notes_log+f"\n{real_provider_id}\n"
except Exception as e:
raise AssertionError(e)

def __str__(self):
return str(self.provider_accreditation_num)+" - "+str(self.batch_id)

-- 
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@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/29e2a257-2631-4075-9453-8ce95b068f8d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


python manage.py inspectdb > models.py crashing with KeyError: options['no-color']

2018-07-24 Thread dean raemaekers
Hello,

I am trying to use inspectdb to generate models for a legacy database. I 
get the following error:

$ python custom_inspectdb.py

Traceback (most recent call last):
  File "custom_inspectdb.py", line 8, in 
Command().execute(table_name_filter=lambda table_name: table_name in 
tables, database='default')
  File 
"/venv/leg370/lib/python3.7/site-packages/django/core/management/base.py", 
line 314, in execute
if options['no_color']:
KeyError: 'no_color'


-- 
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@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/38702e56-66d6-439b-97de-c47ef36b37e0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


New to this list question

2018-11-23 Thread Dean Karres
Hi,

I just joined this list.  I am new to Django.  I have seen several of the 
most recent postings.  I have a question i want to ask but am not sure if 
this is the correct forum.  The question I want to ask is to get advice on 
what Django module(s) I should use to either get me close to a final 
application or get me all the way there.  I have looked at the list of 
Django modules but there are lots of them and trying to compare/contrast 
while keeping my app goals in mind is proving difficult.  I am hoping folks 
with more experience an help me filter things a bit.  I would offer a 1000 
foot view of what I want to accomplish but it might be longish.  Is that Ok 
here?

Dean

-- 
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@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/74b38627-770c-4b2c-870b-6e0ceb195d23%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Advice on choosing Django modules?

2018-11-23 Thread Dean Karres
Hi,

I have been teaching myself python at the same time I am starting with 
Django.  I have made a great deal of progress with both but am at a place 
where I could really use some advice.  I am trying to build a specialized 
"Membership" application for a US based non-profit.  The non-profit works 
with adults, children and families -- sometimes rather complex family 
structures.  A Membership Application for this entity needs to handle some 
peculiar situations.

I have looked at some of the Django e-commerce plugins but there are a lot 
of them and some seem to take a lot of configuration.  I get lost reading 
the setup/config docs while trying to see how a particular module can be 
configured for my needs.  This is where I need advice.

Because this org does not have money for hardware they will use Squareup 
for on-site dues, fees and product sales.  Squareup and/or Stripe for 
on-line purchases.

The on-line part of the application needs to:

@ allow "Adults", 18 years old or older, to sign-up/register (take profile
data).  Let's call this Adult with a login account an "Account Holder".
@ allow Account Holders to:
* purchase a personal "Adult" membership (one-time or recurring /
subscription) or signal that they will pay in person via with cash or
check.
* purchase one or more memberships for other related Adults or Youth
(under 18 years old).  The "other" membership purchases must take
"non-login" profile data.
* when creating additional memberships be aware of special billing
rates; for example: multiple memberships "belonging" to the Account
Holder are considered to be a "Family Membership".  No Family pays
more than a fixed amount per month.  Also, if multiple Youth 
memberships are created then there is special pricing: the first Youth
is at the regular Youth rate and each additional Youth is at a reduced
rate -- keeping in mind that maximum Family Membership rate.
* cancel Membership(s).
* modify Membership Profile data and payment methods for all Members
belonging to the Account Holder.
@ more than one Account Holder may have financial responsibility for a
"Family Membership".  This can get complex.  The non-profit does not
currently have any complex Family payment situations but in the past there
have been situations where a non-"member" parent/guardian will pay for
one or more members one month and one or more other parent/guardians
will pay for some sub-set of members.  Sometimes these non-members are
also non-Account-Holders.  All of the payments need to be tracked and 
applied to the correct member(s).
@ the "Profile Data" associated with each member needs to include the
obvious: name, birth-date, address, phone number(s) for contact, 
SMS-allowed number(s), emergency contact number(s), email address(es).  
Emergency contact information, especially for Youth, might need multiple 
contacts and an order of contact.
@ the non-profit is educational in nature.  The member information needs to 
carry information about test dates, pass/fail status, current level, class 
attendance dates.  This information should be viewable by the Account 
Holder but can oly be added/modified by an Teachers.
@ Teachers is a group that is made of select Account Holders who are 
Members.  Membership in the Teachers group is managed by Administrators.
@ Administrators is a group that is made of select Teachers.
@ report generation features should be available to Administrators and 
offer 
things like: 
* list of login accounts with no members with options to delete, revoke, 
lock the login accounts.
* list of members with filters for just about anything that can appear in 
the profile data.
* billing related reports: who paid, how much, how, when, in what time 
period, etc
@ Teachers need tools to, at least, take attendance.
@ Teachers and Administrators need the ability to allow new Account Holders 
to sign-up on-sitre; and, to allow Account Holders to add / modify 
account / member information.  Teachers may or may not need the ability to 
"Close" Account Holder accounts, that's still being debated.  They probably 
should be able to Pause accounts with comments that Administrators review.

That is not an exhaustive list but this is probably too long already.

In a nutshell, I need a membership, billing, student tracking app (or 
cooperating apps).  The advice I seek is: which existing Django based 
modules do what I want or come close?

Thanks

-- 
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@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0fa5f920-db2f-494b-a398-6329588abf63%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: E-comm live project

2024-05-04 Thread Dean Mahori
add me +263786881635


On Tue, Apr 30, 2024 at 3:23 PM Kintu Peter  wrote:

> Watsap +256789746493
>
>
> On Monday, March 18, 2024 at 8:26:50 PM UTC+3 1001_prabhjot Singh wrote:
>
>> so i am working on a full stack e-comm website and this project is really
>> very big for me because it's a live project am using django for backend
>> interested one's can send there number for WhatsApp group
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/133bfa88-4044-4bdc-9602-9c3a5ec276b7n%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAOxCe%3DS22%3DXqpQOP9gPAqTR4%2B1xHhMNoCacMMOsMPNa7Kvuhbw%40mail.gmail.com.


[no subject]

2024-05-05 Thread Dean Mahori
Dear Programmers,
My name is Dean Mahori and I'm a student at Chinhoyi University . I'm
working on a university project to build a website using the Django
framework.
I'm currently in the process of developing a website to better connect with
our community and raise awareness about our cause.  While I'm excited to
embark on this project, I'm also new to website development and could
really use some assistance.
I'm particularly interested in using Django, a Python web framework, to
build the website.  I've been doing some research on it and believe it
would be a good fit for our needs.  However, as a beginner, I would greatly
appreciate any guidance or support from experienced Django programmers. I'm
also open to different approaches and suggestions from experienced
programmers.

Here are some specific areas where I could use help:

Project Setup and Best Practices: Ensuring a solid foundation for the
website's development.
Understanding Django Features: Learning how to effectively utilize
Django functionalities for our website.
Building Core functionalities: Developing essential features like user
registration, content management, and potentially donation options.

I understand that volunteering your time is valuable, and I'm incredibly
grateful for any assistance you can offer.  Even if it's just pointing me
in the right direction with resources or tutorials, it would be immensely
helpful.
I'm happy to discuss the project further and answer any questions you may
have.  Please feel free to contact me at deanmah...@gmail.com or
+263786881635
You can also comment with your whatsapp number so that i can create a group
for all of us.

Thank you for your time and consideration.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAOxCe%3DSQMWYKQzf4ODUVqEXqmZB%2BN1R%3DWvbZLNzxAzPa6F7k7A%40mail.gmail.com.


Re: E-comm live project

2024-05-06 Thread Dean Mahori
Add me
+263786881635

Sent from Outlook for Android

From: django-users@googlegroups.com  on behalf 
of amruth bitla 
Sent: Monday, May 6, 2024 6:23:52 PM
To: Django users 
Subject: Re: E-comm live project

Hi  1001_prabhjot Singh,

I am interested, check out my GitHuB Page for Django 
Project, Please Email me.

On Monday, May 6, 2024 at 12:13:13 PM UTC-4 avdesh sharma wrote:
I am interested, +91-9650031844

On Mon, Mar 18, 2024 at 10:56 PM 1001_prabhjot Singh  
wrote:
so i am working on a full stack e-comm website and this project is really very 
big for me because it's a live project am using django for backend interested 
one's can send there number for WhatsApp group

--
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...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1101d563-726a-458e-ad9f-4b91bebf3132n%40googlegroups.com.


--
Warm Regards,
Avdesh Kumar Sharma
9650031844

--
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a84f1fdf-36de-4a79-b628-b2a50c576f3an%40googlegroups.com.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/PAXP193MB2202C8F3EC53FC22B974B0D0FF1C2%40PAXP193MB2202.EURP193.PROD.OUTLOOK.COM.


Context processors, am I doing them right?

2015-02-03 Thread Dean De Leo
Hi,
I am new to Django and I am still going through the tutorial. I've tried
to set up a context processor for the following scenario, and I would
like to obtain some confirmation if this is a proper solution or I am
doing some mess..
In my base template with a header there is a navigation bar. A single
button should be highlighted among the others depending in the current
section / page in the website:


Blog
Projects
...


What I thought so far was to register a universal context processor:

def navbar_selected_menu( request ):
items = {"blog": "", "about": ""}
target = request.META["PATH_INFO"]

def select( key ):
" Select the given key in the dictionary item "
nonlocal items;
items[key] = ' class="selected"';

if re.match( "(^/$)|(^/blog$)|(^/blog/)", target):
select("blog")
if re.match(  "^/about\.s?html", target): # about
select("about")


return {"navbar": {"selected": items}};

and add to all links a variable such as Blog.

Is this solution appropriate or does it exist something clearer?

Moreover, is there the chance to pass explicitly a variable from the url 
mapping to the context processor ?

Kind regards,
Dean


-- 
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@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/54D1543C.6050104%40gmx.com.
For more options, visit https://groups.google.com/d/optout.


Django QuerySets, how to express EXISTS ... IN ...

2015-02-08 Thread Dean De Leo
Hello,
I am trying to find how to filter the entries of my blog by a set of
tags, using the Django models.
In particular there are two relations:
Blog (id, title, content)
Tag ( name, blog_id )
with Tag.blog_id foreign key of Blog.id
I want to select all blog entries that contain a certain set of tags.
For instance, I would express the query in SQL as:
SELECT * FROM blog_blog b WHERE EXISTS ( SELECT 1 FROM blog_tag t WHERE
t.blog_id = b.id AND lower(t.name) IN ('tag1', 'tag2', 'tag3')  );

How to represent the same query with the Django QuerySets ?

Thanks,
Dean De Leo


-- 
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@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/54D78EFA.4030302%40gmx.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django QuerySets, how to express EXISTS ... IN ...

2015-02-08 Thread Dean De Leo
Hi, thanks for the reply.
I still get the error:
Exception Type: AttributeError
Exception Value:

'Tag' object has no attribute 'blog_set'


if rawtags:
taglist = rawtags.split('/');
t = Tag.objects.get(name = "Alpha");
blogentries = t.blog_set.all()
else:
blogentries = Blog.objects.all();



My Models:

# My blog
class Blog(models.Model):
title = models.CharField(max_length=255)
content = models.TextField(max_length=1);
dateAdd = models.DateTimeField(auto_now_add=True, null=False);
dateEdit = models.DateTimeField(auto_now=True);

class Meta:
ordering = ['-id']


class Tag(models.Model):
name = models.CharField(max_length=255, null=False)
blog = models.ForeignKey('Blog', null=False)

class Meta:
unique_together = [("name", "blog",)]
ordering = ["name"]


Am I mispelling something?

Thanks,
Dean De Leo



On 08/02/15 16:55, Neto wrote:
> mytag = Tag.objects.get(id=1)
> mytag.blog_set.all()
>
> Em domingo, 8 de fevereiro de 2015 14:30:25 UTC-2, Dean De Leo escreveu:
>
> Hello,
> I am trying to find how to filter the entries of my blog by a set of
> tags, using the Django models.
> In particular there are two relations:
> Blog (id, title, content)
> Tag ( name, blog_id )
> with Tag.blog_id foreign key of Blog.id
> I want to select all blog entries that contain a certain set of tags.
> For instance, I would express the query in SQL as:
> SELECT * FROM blog_blog b WHERE EXISTS ( SELECT 1 FROM blog_tag t
> WHERE
> t.blog_id = b.id <http://b.id> AND lower(t.name <http://t.name>)
> IN ('tag1', 'tag2', 'tag3')  );
>
> How to represent the same query with the Django QuerySets ?
>
> Thanks,
> Dean De Leo
>
>

-- 
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@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/54D7A007.7070405%40gmx.com.
For more options, visit https://groups.google.com/d/optout.


Admin List Per Page Dropdown UI

2015-07-07 Thread Dean Christian Armada
Hi Everyone,

Is there an available option in the UI of Django Admin to manually select 
how many records to be shown per page?

-- 
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@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4c52609d-3eac-44bf-b035-2930d5e6e3d4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Admin List Per Page Dropdown UI

2015-07-07 Thread Dean Christian Armada
This is not what I meant..

This will just set once the admin is loaded. What I want is I can 
manipulate the number records shown within the interface

On Tuesday, July 7, 2015 at 7:34:23 PM UTC+8, larry@gmail.com wrote:
>
> On Tue, Jul 7, 2015 at 7:12 AM, Dean Christian Armada 
> > wrote: 
> > Hi Everyone, 
> > 
> > Is there an available option in the UI of Django Admin to manually 
> select 
> > how many records to be shown per page? 
>
>
> https://docs.djangoproject.com/en/1.8/ref/contrib/admin/#django.contrib.admin.ModelAdmin.list_per_page
>  
>

-- 
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@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/be5327c0-393c-4067-9e98-526086b1b8a4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.